| 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 2796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2807 * See [StaticWarningCode.CONST_WITH_ABSTRACT_CLASS], and | 2807 * See [StaticWarningCode.CONST_WITH_ABSTRACT_CLASS], and |
| 2808 * [StaticWarningCode.NEW_WITH_ABSTRACT_CLASS]. | 2808 * [StaticWarningCode.NEW_WITH_ABSTRACT_CLASS]. |
| 2809 */ | 2809 */ |
| 2810 void _checkForConstOrNewWithAbstractClass( | 2810 void _checkForConstOrNewWithAbstractClass( |
| 2811 InstanceCreationExpression expression, | 2811 InstanceCreationExpression expression, |
| 2812 TypeName typeName, | 2812 TypeName typeName, |
| 2813 InterfaceType type) { | 2813 InterfaceType type) { |
| 2814 if (type.element.isAbstract) { | 2814 if (type.element.isAbstract) { |
| 2815 ConstructorElement element = expression.staticElement; | 2815 ConstructorElement element = expression.staticElement; |
| 2816 if (element != null && !element.isFactory) { | 2816 if (element != null && !element.isFactory) { |
| 2817 if ((expression.keyword as KeywordToken).keyword == Keyword.CONST) { | 2817 if (expression.keyword.keyword == Keyword.CONST) { |
| 2818 _errorReporter.reportErrorForNode( | 2818 _errorReporter.reportErrorForNode( |
| 2819 StaticWarningCode.CONST_WITH_ABSTRACT_CLASS, typeName); | 2819 StaticWarningCode.CONST_WITH_ABSTRACT_CLASS, typeName); |
| 2820 } else { | 2820 } else { |
| 2821 _errorReporter.reportErrorForNode( | 2821 _errorReporter.reportErrorForNode( |
| 2822 StaticWarningCode.NEW_WITH_ABSTRACT_CLASS, typeName); | 2822 StaticWarningCode.NEW_WITH_ABSTRACT_CLASS, typeName); |
| 2823 } | 2823 } |
| 2824 } | 2824 } |
| 2825 } | 2825 } |
| 2826 } | 2826 } |
| 2827 | 2827 |
| (...skipping 3334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6162 class _InvocationCollector extends RecursiveAstVisitor { | 6162 class _InvocationCollector extends RecursiveAstVisitor { |
| 6163 final List<String> superCalls = <String>[]; | 6163 final List<String> superCalls = <String>[]; |
| 6164 | 6164 |
| 6165 @override | 6165 @override |
| 6166 visitMethodInvocation(MethodInvocation node) { | 6166 visitMethodInvocation(MethodInvocation node) { |
| 6167 if (node.target is SuperExpression) { | 6167 if (node.target is SuperExpression) { |
| 6168 superCalls.add(node.methodName.name); | 6168 superCalls.add(node.methodName.name); |
| 6169 } | 6169 } |
| 6170 } | 6170 } |
| 6171 } | 6171 } |
| OLD | NEW |