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

Unified Diff: compiler/java/com/google/dart/compiler/type/Types.java

Issue 11776037: Initial support for mixins in dartc. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Forgot MixinScope.java Created 7 years, 11 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: compiler/java/com/google/dart/compiler/type/Types.java
diff --git a/compiler/java/com/google/dart/compiler/type/Types.java b/compiler/java/com/google/dart/compiler/type/Types.java
index 021ec432079972abe10a3e3ba7c2c660ff7fe7db..14faa69525a74218929789f859a36ec793aab128 100644
--- a/compiler/java/com/google/dart/compiler/type/Types.java
+++ b/compiler/java/com/google/dart/compiler/type/Types.java
@@ -213,6 +213,10 @@ public class Types {
intf = asSupertype(interfaceType, intf);
types.addAll(getSuperTypes(intf));
}
+ for (InterfaceType mixin : interfaceType.getElement().getMixins()) {
+ mixin = asSupertype(interfaceType, mixin);
+ types.add(mixin);
+ }
if (!interfaceType.getElement().isInterface()) {
InterfaceType superClass = interfaceType.getElement().getSupertype();
superClass= asSupertype(interfaceType, superClass);
@@ -545,13 +549,19 @@ public class Types {
}
}
// interfaces
- for (InterfaceType intrface : tElement.getInterfaces()) {
- InterfaceType result = checkedAsInstanceOf(asSupertype(ti, intrface), element,
+ for (InterfaceType intf : tElement.getInterfaces()) {
+ InterfaceType result = checkedAsInstanceOf(asSupertype(ti, intf), element,
variablesReferenced, checkedTypes);
if (result != null) {
return result;
}
}
+ // mixins
+ for (InterfaceType mixin : tElement.getMixins()) {
+ if (mixin.getElement().equals(element)) {
+ return asSupertype(ti, mixin);
+ }
+ }
// no
return null;
}

Powered by Google App Engine
This is Rietveld 408576698