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

Side by Side Diff: lib/compiler/implementation/universe/universe.dart

Issue 11315005: Fix for issue #6259: also look for subclasses when checking if a typed selector applies to an eleme… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 universe; 5 library universe;
6 6
7 import '../closure.dart'; 7 import '../closure.dart';
8 import '../elements/elements.dart'; 8 import '../elements/elements.dart';
9 import '../dart2jslib.dart'; 9 import '../dart2jslib.dart';
10 import '../runtime_types.dart'; 10 import '../runtime_types.dart';
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 // class A { 519 // class A {
520 // get foo => () => 42; 520 // get foo => () => 42;
521 // bar() => foo(); // The call to 'foo' is a typed selector. 521 // bar() => foo(); // The call to 'foo' is a typed selector.
522 // } 522 // }
523 ClassElement other = element.getEnclosingClass(); 523 ClassElement other = element.getEnclosingClass();
524 if (identical(other.superclass, compiler.closureClass)) { 524 if (identical(other.superclass, compiler.closureClass)) {
525 return appliesUntyped(element, compiler); 525 return appliesUntyped(element, compiler);
526 } 526 }
527 527
528 ClassElement self = receiverType.element; 528 ClassElement self = receiverType.element;
529 if (other.implementsInterface(self) || other.isSubclassOf(self)) { 529
530 // [TypedSelector] are only used when compiling.
531 assert(compiler.phase == Compiler.PHASE_COMPILING);
ahe 2012/10/29 14:22:14 Perhaps this assertion should be the first line of
ngeoffray 2012/10/29 14:37:53 Done.
532
533 if (other.implementsInterface(self)
534 || other.isSubclassOf(self)
535 || compiler.world.hasOneSubclassThatImplements(other, receiverType)) {
530 return appliesUntyped(element, compiler); 536 return appliesUntyped(element, compiler);
531 } 537 }
532 538
533 if (!self.isInterface() && self.isSubclassOf(other)) { 539 if (!self.isInterface() && self.isSubclassOf(other)) {
534 // Resolve an invocation of [element.name] on [self]. If it 540 // Resolve an invocation of [element.name] on [self]. If it
535 // is found, this selector is a candidate. 541 // is found, this selector is a candidate.
536 return hasElementIn(self, element) && appliesUntyped(element, compiler); 542 return hasElementIn(self, element) && appliesUntyped(element, compiler);
537 } 543 }
538 544
539 return false; 545 return false;
540 } 546 }
541 } 547 }
OLDNEW
« no previous file with comments | « no previous file | lib/compiler/implementation/world.dart » ('j') | lib/compiler/implementation/world.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698