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

Unified Diff: lib/compiler/implementation/elements/elements.dart

Issue 9980004: Look up the correct constructor for default classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 9 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
« no previous file with comments | « no previous file | lib/compiler/implementation/lib/io.dart » ('j') | lib/compiler/implementation/resolver.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/elements/elements.dart
diff --git a/lib/compiler/implementation/elements/elements.dart b/lib/compiler/implementation/elements/elements.dart
index c1da9dc56336a3824608c1280028f9d14e37012b..a80e63a7460de4a2507ae0d2364bdd1cd61434ea 100644
--- a/lib/compiler/implementation/elements/elements.dart
+++ b/lib/compiler/implementation/elements/elements.dart
@@ -825,6 +825,20 @@ class ClassElement extends ContainerElement {
forEachMember(fieldFilter, includeBackendMembers, includeSuperMembers);
}
+ bool implementsInterface(ClassElement intrface) {
+ assert(intrface.isInterface());
ahe 2012/04/10 14:30:38 I don't think this assertion is correct. We have i
floitsch 2012/04/11 11:40:56 Done.
+ if (allSupertypes === null) {
ahe 2012/04/10 14:30:38 I don't understand why this is better than a null
floitsch 2012/04/11 11:40:56 removed.
+ throw "internal error: implementsInterface with allSupertypes == null.";
ahe 2012/04/10 14:30:38 Long line: trailing whitespace?
floitsch 2012/04/11 11:40:56 removed.
+ }
+ for (Type implementedInterfaceType in allSupertypes) {
+ ClassElement implementedInterface = implementedInterfaceType.element;
+ if (implementedInterface == intrface) {
ahe 2012/04/10 14:30:38 Use ===, not ==.
floitsch 2012/04/11 11:40:56 Done.
+ return true;
+ }
+ }
+ return false;
+ }
+
bool isInterface() => false;
bool isNative() => nativeName != null;
SourceString nativeName;
« no previous file with comments | « no previous file | lib/compiler/implementation/lib/io.dart » ('j') | lib/compiler/implementation/resolver.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698