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

Unified Diff: compiler/java/com/google/dart/compiler/resolver/TopLevelElementBuilder.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/resolver/TopLevelElementBuilder.java
diff --git a/compiler/java/com/google/dart/compiler/resolver/TopLevelElementBuilder.java b/compiler/java/com/google/dart/compiler/resolver/TopLevelElementBuilder.java
index 89e204c072b5b16ef54f060f462f8b5749037b92..eb49f529771483ed3ab4a12ef6fb1983715c11a4 100644
--- a/compiler/java/com/google/dart/compiler/resolver/TopLevelElementBuilder.java
+++ b/compiler/java/com/google/dart/compiler/resolver/TopLevelElementBuilder.java
@@ -14,6 +14,7 @@ import com.google.dart.compiler.DartCompilerListener;
import com.google.dart.compiler.ErrorCode;
import com.google.dart.compiler.ast.ASTVisitor;
import com.google.dart.compiler.ast.DartClass;
+import com.google.dart.compiler.ast.DartClassTypeAlias;
import com.google.dart.compiler.ast.DartField;
import com.google.dart.compiler.ast.DartFieldDefinition;
import com.google.dart.compiler.ast.DartFunctionTypeAlias;
@@ -283,6 +284,19 @@ public class TopLevelElementBuilder {
}
@Override
+ public Void visitClassTypeAlias(DartClassTypeAlias node) {
+ ClassAliasElement element = Elements.classFromNode(node, library);
+ List<DartTypeParameter> parameterNodes = node.getTypeParameters();
+ List<TypeVariable> typeVariables = Elements.makeTypeVariables(parameterNodes, element);
+ element.setType(Types.interfaceType(
+ element,
+ Collections.<Type>unmodifiableList(typeVariables)));
+ node.setElement(element);
+ node.getName().setElement(element);
+ return null;
+ }
+
+ @Override
public Void visitFunctionTypeAlias(DartFunctionTypeAlias node) {
FunctionAliasElement element = Elements.functionTypeAliasFromNode(node, library);
List<DartTypeParameter> parameterNodes = node.getTypeParameters();

Powered by Google App Engine
This is Rietveld 408576698