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

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

Issue 2646983003: Issue 28100. Fix for indirect not instantiated types, tests. (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 | « no previous file | pkg/analyzer/test/generated/strong_mode_test.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 b18fe654c5ae5f0ec024e1b50edef88fa9851780..41654bdee88249b5a72d5dc37cb68a7d2f942579 100644
--- a/pkg/analyzer/lib/src/generated/error_verifier.dart
+++ b/pkg/analyzer/lib/src/generated/error_verifier.dart
@@ -5198,15 +5198,20 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
}
void _checkForNotInstantiatedBound(TypeAnnotation node) {
- if (!_options.strongMode ||
- node == null ||
- (node is TypeName && node.typeArguments != null)) {
+ if (!_options.strongMode || node == null) {
return;
}
- DartType type = node.type;
- if (type is InterfaceType && type.element.typeParameters.isNotEmpty) {
- _errorReporter.reportErrorForNode(
- StrongModeCode.NOT_INSTANTIATED_BOUND, node, [type]);
+
+ if (node is TypeName) {
Brian Wilkerson 2017/01/20 15:41:58 For GenericFunctionType I think we will need to ch
scheglov 2017/01/20 16:05:44 Done.
+ if (node.typeArguments == null) {
+ DartType type = node.type;
+ if (type is InterfaceType && type.element.typeParameters.isNotEmpty) {
+ _errorReporter.reportErrorForNode(
+ StrongModeCode.NOT_INSTANTIATED_BOUND, node, [type]);
+ }
+ } else {
+ node.typeArguments.arguments.forEach(_checkForNotInstantiatedBound);
+ }
}
}
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/strong_mode_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698