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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/strong_mode_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5180 matching lines...) Expand 10 before | Expand all | Expand 10 after
5191 if (typeName != null) { 5191 if (typeName != null) {
5192 DartType type = typeName.type; 5192 DartType type = typeName.type;
5193 if (type != null && !type.isVoid) { 5193 if (type != null && !type.isVoid) {
5194 _errorReporter.reportErrorForNode( 5194 _errorReporter.reportErrorForNode(
5195 StaticWarningCode.NON_VOID_RETURN_FOR_SETTER, typeName); 5195 StaticWarningCode.NON_VOID_RETURN_FOR_SETTER, typeName);
5196 } 5196 }
5197 } 5197 }
5198 } 5198 }
5199 5199
5200 void _checkForNotInstantiatedBound(TypeAnnotation node) { 5200 void _checkForNotInstantiatedBound(TypeAnnotation node) {
5201 if (!_options.strongMode || 5201 if (!_options.strongMode || node == null) {
5202 node == null ||
5203 (node is TypeName && node.typeArguments != null)) {
5204 return; 5202 return;
5205 } 5203 }
5206 DartType type = node.type; 5204
5207 if (type is InterfaceType && type.element.typeParameters.isNotEmpty) { 5205 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.
5208 _errorReporter.reportErrorForNode( 5206 if (node.typeArguments == null) {
5209 StrongModeCode.NOT_INSTANTIATED_BOUND, node, [type]); 5207 DartType type = node.type;
5208 if (type is InterfaceType && type.element.typeParameters.isNotEmpty) {
5209 _errorReporter.reportErrorForNode(
5210 StrongModeCode.NOT_INSTANTIATED_BOUND, node, [type]);
5211 }
5212 } else {
5213 node.typeArguments.arguments.forEach(_checkForNotInstantiatedBound);
5214 }
5210 } 5215 }
5211 } 5216 }
5212 5217
5213 /** 5218 /**
5214 * Verify the given operator-method [declaration], does not have an optional 5219 * Verify the given operator-method [declaration], does not have an optional
5215 * parameter. This method assumes that the method declaration was tested to be 5220 * parameter. This method assumes that the method declaration was tested to be
5216 * an operator declaration before being called. 5221 * an operator declaration before being called.
5217 * 5222 *
5218 * See [CompileTimeErrorCode.OPTIONAL_PARAMETER_IN_OPERATOR]. 5223 * See [CompileTimeErrorCode.OPTIONAL_PARAMETER_IN_OPERATOR].
5219 */ 5224 */
(...skipping 1832 matching lines...) Expand 10 before | Expand all | Expand 10 after
7052 class _InvocationCollector extends RecursiveAstVisitor { 7057 class _InvocationCollector extends RecursiveAstVisitor {
7053 final List<String> superCalls = <String>[]; 7058 final List<String> superCalls = <String>[];
7054 7059
7055 @override 7060 @override
7056 visitMethodInvocation(MethodInvocation node) { 7061 visitMethodInvocation(MethodInvocation node) {
7057 if (node.target is SuperExpression) { 7062 if (node.target is SuperExpression) {
7058 superCalls.add(node.methodName.name); 7063 superCalls.add(node.methodName.name);
7059 } 7064 }
7060 } 7065 }
7061 } 7066 }
OLDNEW
« 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