| 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 2568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2579 StaticWarningCode.ASSIGNMENT_TO_TYPE, expression); | 2579 StaticWarningCode.ASSIGNMENT_TO_TYPE, expression); |
| 2580 } | 2580 } |
| 2581 } | 2581 } |
| 2582 | 2582 |
| 2583 /** | 2583 /** |
| 2584 * Verifies that the class is not named `Function` and that it doesn't | 2584 * Verifies that the class is not named `Function` and that it doesn't |
| 2585 * extends/implements/mixes in `Function`. | 2585 * extends/implements/mixes in `Function`. |
| 2586 */ | 2586 */ |
| 2587 void _checkForBadFunctionUse(ClassDeclaration node) { | 2587 void _checkForBadFunctionUse(ClassDeclaration node) { |
| 2588 ExtendsClause extendsClause = node.extendsClause; | 2588 ExtendsClause extendsClause = node.extendsClause; |
| 2589 ImplementsClause implementsClause = node.implementsClause; | |
| 2590 WithClause withClause = node.withClause; | 2589 WithClause withClause = node.withClause; |
| 2591 | 2590 |
| 2592 if (node.name.name == "Function") { | 2591 if (node.name.name == "Function") { |
| 2593 _errorReporter.reportErrorForNode( | 2592 _errorReporter.reportErrorForNode( |
| 2594 HintCode.DEPRECATED_FUNCTION_CLASS_DECLARATION, node.name); | 2593 HintCode.DEPRECATED_FUNCTION_CLASS_DECLARATION, node.name); |
| 2595 } | 2594 } |
| 2596 | 2595 |
| 2597 if (extendsClause != null) { | 2596 if (extendsClause != null) { |
| 2598 InterfaceType superclassType = _enclosingClass.supertype; | 2597 InterfaceType superclassType = _enclosingClass.supertype; |
| 2599 ClassElement superclassElement = superclassType?.element; | 2598 ClassElement superclassElement = superclassType?.element; |
| (...skipping 4478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7078 class _InvocationCollector extends RecursiveAstVisitor { | 7077 class _InvocationCollector extends RecursiveAstVisitor { |
| 7079 final List<String> superCalls = <String>[]; | 7078 final List<String> superCalls = <String>[]; |
| 7080 | 7079 |
| 7081 @override | 7080 @override |
| 7082 visitMethodInvocation(MethodInvocation node) { | 7081 visitMethodInvocation(MethodInvocation node) { |
| 7083 if (node.target is SuperExpression) { | 7082 if (node.target is SuperExpression) { |
| 7084 superCalls.add(node.methodName.name); | 7083 superCalls.add(node.methodName.name); |
| 7085 } | 7084 } |
| 7086 } | 7085 } |
| 7087 } | 7086 } |
| OLD | NEW |