Chromium Code Reviews| 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; |