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

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

Issue 2769703002: Revert "Issue 28580. Relax instantiate to bounds." (Closed)
Patch Set: Created 3 years, 9 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/dart/element/type.dart ('k') | pkg/analyzer/lib/src/generated/resolver.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 afba5036f17899bc83a3d4abdf5d92cf21862d89..dcc6853a2d3fa9808e2dd4c5c29a35bf24a2f75f 100644
--- a/pkg/analyzer/lib/src/generated/error_verifier.dart
+++ b/pkg/analyzer/lib/src/generated/error_verifier.dart
@@ -5342,9 +5342,13 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
if (node is TypeName) {
if (node.typeArguments == null) {
DartType type = node.type;
- if (type is TypeImpl && type.hasTypeParameterReferenceInBound) {
- _errorReporter.reportErrorForNode(
- StrongModeCode.NOT_INSTANTIATED_BOUND, node, [type]);
+ if (type is ParameterizedType) {
+ Element element = type.element;
+ if (element is TypeParameterizedElement &&
+ element.typeParameters.any((p) => p.bound != null)) {
+ _errorReporter.reportErrorForNode(
+ StrongModeCode.NOT_INSTANTIATED_BOUND, node, [type]);
+ }
}
} else {
node.typeArguments.arguments.forEach(_checkForNotInstantiatedBound);
« no previous file with comments | « pkg/analyzer/lib/src/dart/element/type.dart ('k') | pkg/analyzer/lib/src/generated/resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698