Add mixin support to InterfaceTypeImpl.isMoreSpecificThan.

In the long run we should eliminate the code duplication between
InterfaceTypeImpl.isMoreSpecificThan and TypeSystem.isMoreSpecificThan
(see #34653), but this gets us past the immediate bug.

Fixes #34641.

Change-Id: I0a7935cff7a0d73728a918db7513e46ff73bc984
Reviewed-on: https://dart-review.googlesource.com/c/77676
Auto-Submit: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
Paul Berry 2018-10-03 00:01:16 +00:00 committed by commit-bot@chromium.org
parent d2e08e4952
commit 621c41f091

View file

@ -1706,6 +1706,14 @@ class InterfaceTypeImpl extends TypeImpl implements InterfaceType {
return true;
}
}
if (element.isMixin) {
for (InterfaceType constraint in superclassConstraints) {
if ((constraint as InterfaceTypeImpl)
.isMoreSpecificThan(type, withDynamic, visitedElements)) {
return true;
}
}
}
// If a type I includes an instance method named `call`, and the type of
// `call` is the function type F, then I is considered to be more specific
// than F.