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

Unified Diff: sdk/lib/_internal/compiler/implementation/types/flat_type_mask.dart

Issue 15712007: Fix bug in ClassElement.lookupSelector: by returning an abstract method, we were not returning the … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 months 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/compiler/implementation/types/flat_type_mask.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/types/flat_type_mask.dart (revision 23237)
+++ sdk/lib/_internal/compiler/implementation/types/flat_type_mask.dart (working copy)
@@ -383,19 +383,22 @@
*/
static bool hasElementIn(ClassElement cls,
Selector selector,
- Element element) {
+ Element element,
+ Compiler compiler) {
// Use [:implementation:] of [element]
// because our function set only stores declarations.
- Element result = findMatchIn(cls, selector);
+ Element result = findMatchIn(cls, selector, compiler);
return result == null
? false
: result.implementation == element.implementation;
}
- static Element findMatchIn(ClassElement cls, Selector selector) {
+ static Element findMatchIn(ClassElement cls,
+ Selector selector,
+ Compiler compiler) {
// Use the [:implementation] of [cls] in case the found [element]
// is in the patch class.
- return cls.implementation.lookupSelector(selector);
+ return cls.implementation.lookupSelector(selector, compiler);
}
/**
@@ -408,7 +411,7 @@
if (isEmpty) {
if (!isNullable) return false;
return hasElementIn(
- compiler.backend.nullImplementation, selector, element);
+ compiler.backend.nullImplementation, selector, element, compiler);
}
// TODO(kasperl): Can't we just avoid creating typed selectors
@@ -424,14 +427,14 @@
if (compiler.backend.isNullImplementation(other)) {
return isNullable;
} else if (isExact) {
- return hasElementIn(self, selector, element);
+ return hasElementIn(self, selector, element, compiler);
} else if (isSubclass) {
- return hasElementIn(self, selector, element)
+ return hasElementIn(self, selector, element, compiler)
|| other.isSubclassOf(self)
|| compiler.world.hasAnySubclassThatMixes(self, other);
} else {
assert(isSubtype);
- return hasElementIn(self, selector, element)
+ return hasElementIn(self, selector, element, compiler)
|| other.implementsInterface(self)
|| other.isSubclassOf(self)
|| compiler.world.hasAnySubclassThatMixes(self, other)
@@ -446,7 +449,7 @@
static bool hasConcreteMatch(ClassElement cls,
Selector selector,
Compiler compiler) {
- Element element = findMatchIn(cls, selector);
+ Element element = findMatchIn(cls, selector, compiler);
if (element == null) return false;
if (element.isAbstract(compiler)) {
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/resolution/members.dart ('k') | tests/language/super_abstract_method_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698