Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(230)

Side by Side Diff: pkg/analyzer/lib/src/generated/error_verifier.dart

Issue 698973005: Always check if instance method name collides with superclass static. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/static_warning_code_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 engine.resolver.error_verifier; 5 library engine.resolver.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 'java_engine.dart'; 10 import 'java_engine.dart';
(...skipping 1400 matching lines...) Expand 10 before | Expand all | Expand 10 after
1411 * @param executableElement a non-null [ExecutableElement] to evaluate 1411 * @param executableElement a non-null [ExecutableElement] to evaluate
1412 * @param parameters the parameters of the executable element 1412 * @param parameters the parameters of the executable element
1413 * @param errorNameTarget the node to report problems on 1413 * @param errorNameTarget the node to report problems on
1414 * @return `true` if and only if an error code is generated on the passed node 1414 * @return `true` if and only if an error code is generated on the passed node
1415 */ 1415 */
1416 bool _checkForAllInvalidOverrideErrorCodesForExecutable(ExecutableElement exec utableElement, List<ParameterElement> parameters, List<AstNode> parameterLocatio ns, SimpleIdentifier errorNameTarget) { 1416 bool _checkForAllInvalidOverrideErrorCodesForExecutable(ExecutableElement exec utableElement, List<ParameterElement> parameters, List<AstNode> parameterLocatio ns, SimpleIdentifier errorNameTarget) {
1417 // 1417 //
1418 // Compute the overridden executable from the InheritanceManager 1418 // Compute the overridden executable from the InheritanceManager
1419 // 1419 //
1420 List<ExecutableElement> overriddenExecutables = _inheritanceManager.lookupOv errides(_enclosingClass, executableElement.name); 1420 List<ExecutableElement> overriddenExecutables = _inheritanceManager.lookupOv errides(_enclosingClass, executableElement.name);
1421 if (overriddenExecutables.isEmpty) { 1421 if (_checkForInstanceMethodNameCollidesWithSuperclassStatic(
1422 // Nothing is overridden, so we just have to check if the new name collide s 1422 executableElement, errorNameTarget)) {
1423 // with a static defined in the superclass. 1423 return true;
1424 // TODO(paulberry): currently we don't do this check if the new element
1425 // overrides a method in an interface (see issue 18947).
1426 return _checkForInstanceMethodNameCollidesWithSuperclassStatic(executableE lement, errorNameTarget);
1427 } 1424 }
1428 for (ExecutableElement overriddenElement in overriddenExecutables) { 1425 for (ExecutableElement overriddenElement in overriddenExecutables) {
1429 if (_checkForAllInvalidOverrideErrorCodes(executableElement, overriddenEle ment, parameters, parameterLocations, errorNameTarget)) { 1426 if (_checkForAllInvalidOverrideErrorCodes(executableElement, overriddenEle ment, parameters, parameterLocations, errorNameTarget)) {
1430 return true; 1427 return true;
1431 } 1428 }
1432 } 1429 }
1433 return false; 1430 return false;
1434 } 1431 }
1435 1432
1436 /** 1433 /**
(...skipping 4052 matching lines...) Expand 10 before | Expand all | Expand 10 after
5489 toCheck.add(element); 5486 toCheck.add(element);
5490 // type arguments 5487 // type arguments
5491 if (type is InterfaceType) { 5488 if (type is InterfaceType) {
5492 InterfaceType interfaceType = type; 5489 InterfaceType interfaceType = type;
5493 for (DartType typeArgument in interfaceType.typeArguments) { 5490 for (DartType typeArgument in interfaceType.typeArguments) {
5494 _addTypeToCheck(typeArgument); 5491 _addTypeToCheck(typeArgument);
5495 } 5492 }
5496 } 5493 }
5497 } 5494 }
5498 } 5495 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/static_warning_code_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698