| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 // TODO(jmesserly): this was ported from package:dev_compiler, and needs to be | 5 // TODO(jmesserly): this was ported from package:dev_compiler, and needs to be |
| 6 // refactored to fit into analyzer. | 6 // refactored to fit into analyzer. |
| 7 library analyzer.src.task.strong.checker; | 7 library analyzer.src.task.strong.checker; |
| 8 | 8 |
| 9 import 'package:analyzer/analyzer.dart'; | 9 import 'package:analyzer/analyzer.dart'; |
| 10 import 'package:analyzer/dart/ast/ast.dart'; | 10 import 'package:analyzer/dart/ast/ast.dart'; |
| (...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 985 // non-abstract class is not implementing an interface. See | 985 // non-abstract class is not implementing an interface. See |
| 986 // https://github.com/dart-lang/dart-dev-compiler/issues/25 | 986 // https://github.com/dart-lang/dart-dev-compiler/issues/25 |
| 987 while (parent != null && parent.element.isAbstract) { | 987 while (parent != null && parent.element.isAbstract) { |
| 988 parent.interfaces.forEach((i) => find(i, superInterfaces)); | 988 parent.interfaces.forEach((i) => find(i, superInterfaces)); |
| 989 parent = parent.superclass; | 989 parent = parent.superclass; |
| 990 } | 990 } |
| 991 _checkInterfacesOverrides(node, superInterfaces, seen, | 991 _checkInterfacesOverrides(node, superInterfaces, seen, |
| 992 includeParents: false); | 992 includeParents: false); |
| 993 } | 993 } |
| 994 | 994 |
| 995 /// Check that individual methods and fields in [subType] correctly override | 995 /// Check that individual methods and fields in [node] correctly override |
| 996 /// the declarations in [baseType]. | 996 /// the declarations in [baseType]. |
| 997 /// | 997 /// |
| 998 /// The [errorLocation] node indicates where errors are reported, see | 998 /// The [errorLocation] node indicates where errors are reported, see |
| 999 /// [_checkSingleOverride] for more details. | 999 /// [_checkSingleOverride] for more details. |
| 1000 _checkIndividualOverridesFromClass(ClassDeclaration node, | 1000 _checkIndividualOverridesFromClass(ClassDeclaration node, |
| 1001 InterfaceType baseType, Set<String> seen, bool isSubclass) { | 1001 InterfaceType baseType, Set<String> seen, bool isSubclass) { |
| 1002 for (var member in node.members) { | 1002 for (var member in node.members) { |
| 1003 if (member is FieldDeclaration) { | 1003 if (member is FieldDeclaration) { |
| 1004 if (member.isStatic) { | 1004 if (member.isStatic) { |
| 1005 continue; | 1005 continue; |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1266 } while (!current.isObject && !visited.contains(current)); | 1266 } while (!current.isObject && !visited.contains(current)); |
| 1267 } | 1267 } |
| 1268 | 1268 |
| 1269 void _recordMessage(StaticInfo info) { | 1269 void _recordMessage(StaticInfo info) { |
| 1270 if (info == null) return; | 1270 if (info == null) return; |
| 1271 var error = info.toAnalysisError(); | 1271 var error = info.toAnalysisError(); |
| 1272 if (error.errorCode.errorSeverity == ErrorSeverity.ERROR) _failure = true; | 1272 if (error.errorCode.errorSeverity == ErrorSeverity.ERROR) _failure = true; |
| 1273 _reporter.onError(error); | 1273 _reporter.onError(error); |
| 1274 } | 1274 } |
| 1275 } | 1275 } |
| OLD | NEW |