Index: pkg/analyzer/lib/src/generated/type_system.dart |
diff --git a/pkg/analyzer/lib/src/generated/type_system.dart b/pkg/analyzer/lib/src/generated/type_system.dart |
index 8826bfb02568bd647c9c5baff5ad75194d40f19b..d4860c23974a0924eb5ea838b12376513109c945 100644 |
--- a/pkg/analyzer/lib/src/generated/type_system.dart |
+++ b/pkg/analyzer/lib/src/generated/type_system.dart |
@@ -11,12 +11,12 @@ import 'package:analyzer/dart/ast/ast.dart' show AstNode; |
import 'package:analyzer/dart/ast/token.dart' show TokenType; |
import 'package:analyzer/dart/element/element.dart'; |
import 'package:analyzer/dart/element/type.dart'; |
+import 'package:analyzer/error/listener.dart' show ErrorReporter; |
import 'package:analyzer/src/dart/element/element.dart'; |
import 'package:analyzer/src/dart/element/type.dart'; |
+import 'package:analyzer/src/error/codes.dart' show StrongModeCode; |
import 'package:analyzer/src/generated/engine.dart' |
show AnalysisContext, AnalysisOptionsImpl; |
-import 'package:analyzer/src/generated/error.dart' |
- show ErrorReporter, StrongModeCode; |
import 'package:analyzer/src/generated/resolver.dart' show TypeProvider; |
import 'package:analyzer/src/generated/utilities_dart.dart' show ParameterKind; |
import 'package:analyzer/src/generated/utilities_general.dart' |
@@ -566,6 +566,21 @@ class StrongTypeSystemImpl extends TypeSystem { |
!nonnullableTypes.contains(_getTypeFullyQualifiedName(type)); |
} |
+ /// Check that [f1] is a subtype of [f2] for an override. |
+ /// |
+ /// This is different from the normal function subtyping in two ways: |
+ /// - we know the function types are strict arrows, |
+ /// - it allows opt-in covariant parameters. |
+ bool isOverrideSubtypeOf(FunctionType f1, FunctionType f2) { |
+ return FunctionTypeImpl.relate( |
+ f1, |
+ f2, |
+ (t1, t2, t1Covariant, _) => |
+ isSubtypeOf(t2, t1) || t1Covariant && isSubtypeOf(t1, t2), |
+ instantiateToBounds, |
+ returnRelation: isSubtypeOf); |
+ } |
+ |
@override |
bool isSubtypeOf(DartType leftType, DartType rightType) { |
return _isSubtypeOf(leftType, rightType, null); |
@@ -824,21 +839,6 @@ class StrongTypeSystemImpl extends TypeSystem { |
returnRelation: isSubtypeOf); |
} |
- /// Check that [f1] is a subtype of [f2] for an override. |
- /// |
- /// This is different from the normal function subtyping in two ways: |
- /// - we know the function types are strict arrows, |
- /// - it allows opt-in covariant parameters. |
- bool isOverrideSubtypeOf(FunctionType f1, FunctionType f2) { |
- return FunctionTypeImpl.relate( |
- f1, |
- f2, |
- (t1, t2, t1Covariant, _) => |
- isSubtypeOf(t2, t1) || t1Covariant && isSubtypeOf(t1, t2), |
- instantiateToBounds, |
- returnRelation: isSubtypeOf); |
- } |
- |
bool _isInterfaceSubtypeOf( |
InterfaceType i1, InterfaceType i2, Set<Element> visited) { |
// Guard recursive calls |