Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 } |
| OLD | NEW |