Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(968)

Unified Diff: pkg/analyzer/lib/src/generated/type_system.dart

Issue 2342733002: Break up another large file (Closed)
Patch Set: fixed floating comment Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | pkg/analyzer/lib/src/plugin/engine_plugin.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | pkg/analyzer/lib/src/plugin/engine_plugin.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698