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

Unified Diff: pkg/analyzer/lib/src/task/strong/checker.dart

Issue 2540903003: restrict generic function type subtyping (Closed)
Patch Set: patch Created 4 years 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/dart/element/type.dart ('k') | pkg/analyzer/test/generated/type_system_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/task/strong/checker.dart
diff --git a/pkg/analyzer/lib/src/task/strong/checker.dart b/pkg/analyzer/lib/src/task/strong/checker.dart
index 4e2a092523ccfc6d7d1be7f122529b96600a0ddc..6f9ac6e6ea562c6b9933fa16d4151e63d2bab452 100644
--- a/pkg/analyzer/lib/src/task/strong/checker.dart
+++ b/pkg/analyzer/lib/src/task/strong/checker.dart
@@ -1434,15 +1434,7 @@ class _OverrideChecker {
]);
}
}
- FunctionType concreteSubType = subType;
- FunctionType concreteBaseType = baseType;
- if (concreteSubType.typeFormals.isNotEmpty) {
- if (concreteBaseType.typeFormals.isEmpty) {
- concreteSubType = rules.instantiateToBounds(concreteSubType);
- }
- }
-
- if (!rules.isOverrideSubtypeOf(concreteSubType, concreteBaseType)) {
+ if (!rules.isOverrideSubtypeOf(subType, baseType)) {
ErrorCode errorCode;
if (errorLocation is ExtendsClause) {
errorCode = StrongModeCode.INVALID_METHOD_OVERRIDE_FROM_BASE;
« no previous file with comments | « pkg/analyzer/lib/src/dart/element/type.dart ('k') | pkg/analyzer/test/generated/type_system_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698