From 621c41f0911b2ef7b18359b36fa23cf01d81c000 Mon Sep 17 00:00:00 2001 From: Paul Berry Date: Wed, 3 Oct 2018 00:01:16 +0000 Subject: [PATCH] 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 Commit-Queue: Brian Wilkerson Reviewed-by: Brian Wilkerson --- pkg/analyzer/lib/src/dart/element/type.dart | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/analyzer/lib/src/dart/element/type.dart b/pkg/analyzer/lib/src/dart/element/type.dart index db1279bbb72..57622358d9f 100644 --- a/pkg/analyzer/lib/src/dart/element/type.dart +++ b/pkg/analyzer/lib/src/dart/element/type.dart @@ -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.