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 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
861 ConstructorName constructorName = node.constructorName; | 861 ConstructorName constructorName = node.constructorName; |
862 TypeName typeName = constructorName.type; | 862 TypeName typeName = constructorName.type; |
863 DartType type = typeName.type; | 863 DartType type = typeName.type; |
864 if (type is InterfaceType) { | 864 if (type is InterfaceType) { |
865 _checkForConstOrNewWithAbstractClass(node, typeName, type); | 865 _checkForConstOrNewWithAbstractClass(node, typeName, type); |
866 _checkForConstOrNewWithEnum(node, typeName, type); | 866 _checkForConstOrNewWithEnum(node, typeName, type); |
867 if (_isInConstInstanceCreation) { | 867 if (_isInConstInstanceCreation) { |
868 _checkForConstWithNonConst(node); | 868 _checkForConstWithNonConst(node); |
869 _checkForConstWithUndefinedConstructor( | 869 _checkForConstWithUndefinedConstructor( |
870 node, constructorName, typeName); | 870 node, constructorName, typeName); |
871 _checkForConstWithTypeParameters(typeName); | 871 if (!_options.strongMode) { |
| 872 _checkForConstWithTypeParameters(typeName); |
| 873 } |
872 _checkForConstDeferredClass(node, constructorName, typeName); | 874 _checkForConstDeferredClass(node, constructorName, typeName); |
873 } else { | 875 } else { |
874 _checkForNewWithUndefinedConstructor(node, constructorName, typeName); | 876 _checkForNewWithUndefinedConstructor(node, constructorName, typeName); |
875 } | 877 } |
876 } | 878 } |
877 _checkForImplicitDynamicType(typeName); | 879 _checkForImplicitDynamicType(typeName); |
878 return super.visitInstanceCreationExpression(node); | 880 return super.visitInstanceCreationExpression(node); |
879 } finally { | 881 } finally { |
880 _isInConstInstanceCreation = wasInConstInstanceCreation; | 882 _isInConstInstanceCreation = wasInConstInstanceCreation; |
881 } | 883 } |
(...skipping 5568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6450 class _InvocationCollector extends RecursiveAstVisitor { | 6452 class _InvocationCollector extends RecursiveAstVisitor { |
6451 final List<String> superCalls = <String>[]; | 6453 final List<String> superCalls = <String>[]; |
6452 | 6454 |
6453 @override | 6455 @override |
6454 visitMethodInvocation(MethodInvocation node) { | 6456 visitMethodInvocation(MethodInvocation node) { |
6455 if (node.target is SuperExpression) { | 6457 if (node.target is SuperExpression) { |
6456 superCalls.add(node.methodName.name); | 6458 superCalls.add(node.methodName.name); |
6457 } | 6459 } |
6458 } | 6460 } |
6459 } | 6461 } |
OLD | NEW |