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

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

Issue 2658303002: Relax type bound restrictions slightly, apply to typedefs. (Closed)
Patch Set: Typing fix 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 ffef5db56d9e8e3af77f73dad77cd3321a68c279..26c1a026b1ecbeca910a0a526230316f194b395b 100644
--- a/pkg/analyzer/lib/src/generated/error_verifier.dart
+++ b/pkg/analyzer/lib/src/generated/error_verifier.dart
@@ -5239,9 +5239,13 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
if (node is TypeName) {
if (node.typeArguments == null) {
DartType type = node.type;
- if (type is InterfaceType && type.element.typeParameters.isNotEmpty) {
- _errorReporter.reportErrorForNode(
- StrongModeCode.NOT_INSTANTIATED_BOUND, node, [type]);
+ if (type is ParameterizedType) {
Leaf 2017/01/27 23:24:06 This change is to make this apply to typedefs.
+ Element element = type.element;
+ if (element is TypeParameterizedElement &&
+ element.typeParameters.any((p) => p.bound != null)) {
Leaf 2017/01/27 23:24:06 This change is to allow class A<T> {} class B<T
+ _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