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 3806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3817 _errorReporter.reportErrorForNode( | 3817 _errorReporter.reportErrorForNode( |
3818 StaticWarningCode.FINAL_NOT_INITIALIZED, | 3818 StaticWarningCode.FINAL_NOT_INITIALIZED, |
3819 variable.name, | 3819 variable.name, |
3820 [variable.name.name]); | 3820 [variable.name.name]); |
3821 } | 3821 } |
3822 } | 3822 } |
3823 } | 3823 } |
3824 } | 3824 } |
3825 | 3825 |
3826 /** | 3826 /** |
3827 * Verify that final fields in the given clas [declaration] that are declared, | 3827 * Verify that final fields in the given class [declaration] that are |
3828 * without any constructors in the enclosing class, are initialized. Cases in | 3828 * declared, without any constructors in the enclosing class, are |
3829 * which there is at least one constructor are handled at the end of | 3829 * initialized. Cases in which there is at least one constructor are handled |
| 3830 * at the end of |
3830 * [_checkForAllFinalInitializedErrorCodes]. | 3831 * [_checkForAllFinalInitializedErrorCodes]. |
3831 * | 3832 * |
3832 * See [CompileTimeErrorCode.CONST_NOT_INITIALIZED], and | 3833 * See [CompileTimeErrorCode.CONST_NOT_INITIALIZED], and |
3833 * [StaticWarningCode.FINAL_NOT_INITIALIZED]. | 3834 * [StaticWarningCode.FINAL_NOT_INITIALIZED]. |
3834 */ | 3835 */ |
3835 void _checkForFinalNotInitializedInClass(ClassDeclaration declaration) { | 3836 void _checkForFinalNotInitializedInClass(ClassDeclaration declaration) { |
3836 NodeList<ClassMember> classMembers = declaration.members; | 3837 NodeList<ClassMember> classMembers = declaration.members; |
3837 for (ClassMember classMember in classMembers) { | 3838 for (ClassMember classMember in classMembers) { |
3838 if (classMember is ConstructorDeclaration) { | 3839 if (classMember is ConstructorDeclaration) { |
3839 return; | 3840 return; |
(...skipping 3289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7129 class _InvocationCollector extends RecursiveAstVisitor { | 7130 class _InvocationCollector extends RecursiveAstVisitor { |
7130 final List<String> superCalls = <String>[]; | 7131 final List<String> superCalls = <String>[]; |
7131 | 7132 |
7132 @override | 7133 @override |
7133 visitMethodInvocation(MethodInvocation node) { | 7134 visitMethodInvocation(MethodInvocation node) { |
7134 if (node.target is SuperExpression) { | 7135 if (node.target is SuperExpression) { |
7135 superCalls.add(node.methodName.name); | 7136 superCalls.add(node.methodName.name); |
7136 } | 7137 } |
7137 } | 7138 } |
7138 } | 7139 } |
OLD | NEW |