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

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

Issue 2641213002: Issue 28100. In strong mode verify that TypeParameter bound has required type arguments. (Closed)
Patch Set: Created 3 years, 11 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/error/codes.dart ('k') | pkg/analyzer/test/generated/resolver_test_case.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/error_verifier.dart
diff --git a/pkg/analyzer/lib/src/generated/error_verifier.dart b/pkg/analyzer/lib/src/generated/error_verifier.dart
index 209119570a4b6b21ddd2cb439abed3a290406533..b18fe654c5ae5f0ec024e1b50edef88fa9851780 100644
--- a/pkg/analyzer/lib/src/generated/error_verifier.dart
+++ b/pkg/analyzer/lib/src/generated/error_verifier.dart
@@ -1223,6 +1223,7 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
_checkForTypeParameterSupertypeOfItsBound(node);
_checkForTypeAnnotationDeferredClass(node.bound);
_checkForImplicitDynamicType(node.bound);
+ _checkForNotInstantiatedBound(node.bound);
return super.visitTypeParameter(node);
}
@@ -5196,6 +5197,19 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
}
}
+ void _checkForNotInstantiatedBound(TypeAnnotation node) {
+ if (!_options.strongMode ||
+ node == null ||
+ (node is TypeName && node.typeArguments != null)) {
+ return;
+ }
+ DartType type = node.type;
+ if (type is InterfaceType && type.element.typeParameters.isNotEmpty) {
Leaf 2017/01/20 01:43:16 I don't think this handles nested types. This per
scheglov 2017/01/20 15:36:26 ACK. https://codereview.chromium.org/2646983003 wi
+ _errorReporter.reportErrorForNode(
+ StrongModeCode.NOT_INSTANTIATED_BOUND, node, [type]);
+ }
+ }
+
/**
* Verify the given operator-method [declaration], does not have an optional
* parameter. This method assumes that the method declaration was tested to be
« no previous file with comments | « pkg/analyzer/lib/src/error/codes.dart ('k') | pkg/analyzer/test/generated/resolver_test_case.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698