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 5025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5036 FunctionType foundConcreteFT = _inheritanceManager | 5036 FunctionType foundConcreteFT = _inheritanceManager |
5037 .substituteTypeArgumentsInMemberFromInheritance( | 5037 .substituteTypeArgumentsInMemberFromInheritance( |
5038 concreteType, memberName, enclosingType); | 5038 concreteType, memberName, enclosingType); |
5039 FunctionType requiredMemberFT = _inheritanceManager | 5039 FunctionType requiredMemberFT = _inheritanceManager |
5040 .substituteTypeArgumentsInMemberFromInheritance( | 5040 .substituteTypeArgumentsInMemberFromInheritance( |
5041 requiredMemberType, memberName, enclosingType); | 5041 requiredMemberType, memberName, enclosingType); |
5042 foundConcreteFT = _typeSystem.functionTypeToConcreteType( | 5042 foundConcreteFT = _typeSystem.functionTypeToConcreteType( |
5043 _typeProvider, foundConcreteFT); | 5043 _typeProvider, foundConcreteFT); |
5044 requiredMemberFT = _typeSystem.functionTypeToConcreteType( | 5044 requiredMemberFT = _typeSystem.functionTypeToConcreteType( |
5045 _typeProvider, requiredMemberFT); | 5045 _typeProvider, requiredMemberFT); |
5046 if (_typeSystem.isSubtypeOf(foundConcreteFT, requiredMemberFT)) { | 5046 |
| 5047 // Strong mode does override checking for types in CodeChecker, so |
| 5048 // we can skip it here. Doing it here leads to unnecessary duplicate |
| 5049 // error messages in subclasses that inherit from one that has an |
| 5050 // override error. |
| 5051 // |
| 5052 // See: https://github.com/dart-lang/sdk/issues/25232 |
| 5053 if (_options.strongMode || |
| 5054 _typeSystem.isSubtypeOf(foundConcreteFT, requiredMemberFT)) { |
5047 continue; | 5055 continue; |
5048 } | 5056 } |
5049 } | 5057 } |
5050 } | 5058 } |
5051 // The not qualifying concrete executable element was found, add it to the | 5059 // The not qualifying concrete executable element was found, add it to the |
5052 // list. | 5060 // list. |
5053 missingOverrides.add(executableElt); | 5061 missingOverrides.add(executableElt); |
5054 } | 5062 } |
5055 // Now that we have the set of missing overrides, generate a warning on this | 5063 // Now that we have the set of missing overrides, generate a warning on this |
5056 // class. | 5064 // class. |
(...skipping 1838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6895 class _InvocationCollector extends RecursiveAstVisitor { | 6903 class _InvocationCollector extends RecursiveAstVisitor { |
6896 final List<String> superCalls = <String>[]; | 6904 final List<String> superCalls = <String>[]; |
6897 | 6905 |
6898 @override | 6906 @override |
6899 visitMethodInvocation(MethodInvocation node) { | 6907 visitMethodInvocation(MethodInvocation node) { |
6900 if (node.target is SuperExpression) { | 6908 if (node.target is SuperExpression) { |
6901 superCalls.add(node.methodName.name); | 6909 superCalls.add(node.methodName.name); |
6902 } | 6910 } |
6903 } | 6911 } |
6904 } | 6912 } |
OLD | NEW |