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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer.src.generated.error_verifier; 5 library analyzer.src.generated.error_verifier;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import "dart:math" as math; 8 import "dart:math" as math;
9 9
10 import 'package:analyzer/dart/ast/ast.dart'; 10 import 'package:analyzer/dart/ast/ast.dart';
(...skipping 5324 matching lines...) Expand 10 before | Expand all | Expand 10 after
5335 } 5335 }
5336 5336
5337 void _checkForNotInstantiatedBound(TypeAnnotation node) { 5337 void _checkForNotInstantiatedBound(TypeAnnotation node) {
5338 if (!_options.strongMode || node == null) { 5338 if (!_options.strongMode || node == null) {
5339 return; 5339 return;
5340 } 5340 }
5341 5341
5342 if (node is TypeName) { 5342 if (node is TypeName) {
5343 if (node.typeArguments == null) { 5343 if (node.typeArguments == null) {
5344 DartType type = node.type; 5344 DartType type = node.type;
5345 if (type is TypeImpl && type.hasTypeParameterReferenceInBound) { 5345 if (type is ParameterizedType) {
5346 _errorReporter.reportErrorForNode( 5346 Element element = type.element;
5347 StrongModeCode.NOT_INSTANTIATED_BOUND, node, [type]); 5347 if (element is TypeParameterizedElement &&
5348 element.typeParameters.any((p) => p.bound != null)) {
5349 _errorReporter.reportErrorForNode(
5350 StrongModeCode.NOT_INSTANTIATED_BOUND, node, [type]);
5351 }
5348 } 5352 }
5349 } else { 5353 } else {
5350 node.typeArguments.arguments.forEach(_checkForNotInstantiatedBound); 5354 node.typeArguments.arguments.forEach(_checkForNotInstantiatedBound);
5351 } 5355 }
5352 } else { 5356 } else {
5353 throw new UnimplementedError('${node.runtimeType}'); 5357 throw new UnimplementedError('${node.runtimeType}');
5354 } 5358 }
5355 } 5359 }
5356 5360
5357 /** 5361 /**
(...skipping 1809 matching lines...) Expand 10 before | Expand all | Expand 10 after
7167 class _InvocationCollector extends RecursiveAstVisitor { 7171 class _InvocationCollector extends RecursiveAstVisitor {
7168 final List<String> superCalls = <String>[]; 7172 final List<String> superCalls = <String>[];
7169 7173
7170 @override 7174 @override
7171 visitMethodInvocation(MethodInvocation node) { 7175 visitMethodInvocation(MethodInvocation node) {
7172 if (node.target is SuperExpression) { 7176 if (node.target is SuperExpression) {
7173 superCalls.add(node.methodName.name); 7177 superCalls.add(node.methodName.name);
7174 } 7178 }
7175 } 7179 }
7176 } 7180 }
OLDNEW
« 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