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

Unified Diff: compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java

Issue 12039027: Issue 8006. Allow abstract modifier for typedef mixin applications. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
« no previous file with comments | « compiler/java/com/google/dart/compiler/parser/DartParser.java ('k') | tests/language/language.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java
diff --git a/compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java b/compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java
index 3e070aa1f30df48360a0addc9deefed8d78b7d1e..d86da206f6d50f323e9c13e2311f611a988340bf 100644
--- a/compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java
+++ b/compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java
@@ -14,6 +14,7 @@ import com.google.dart.compiler.ast.DartBinaryExpression;
import com.google.dart.compiler.ast.DartBooleanLiteral;
import com.google.dart.compiler.ast.DartCascadeExpression;
import com.google.dart.compiler.ast.DartClass;
+import com.google.dart.compiler.ast.DartClassTypeAlias;
import com.google.dart.compiler.ast.DartComment;
import com.google.dart.compiler.ast.DartExprStmt;
import com.google.dart.compiler.ast.DartExpression;
@@ -115,6 +116,33 @@ public class SyntaxTest extends AbstractParserTest {
assertEquals("D", mixins.get(1).toString());
}
+ public void test_parseTypedefMixin() throws Exception {
+ parseUnit(
+ "test.dart",
+ Joiner.on("\n").join(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "typedef C = A with B;",
+ ""));
+ DartClassTypeAlias typedef = findNode(DartClassTypeAlias.class, "typedef C");
+ assertEquals("A", typedef.getSuperclass().toString());
+ {
+ NodeList<DartTypeNode> mixins = typedef.getMixins();
+ assertEquals(1, mixins.size());
+ assertEquals("B", mixins.get(0).toString());
+ }
+ }
+
+ public void test_parseTypedefMixin_abstract() throws Exception {
+ parseUnit(
+ "test.dart",
+ Joiner.on("\n").join(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "typedef C = abstract A with B;",
+ ""));
+ DartClassTypeAlias typedef = findNode(DartClassTypeAlias.class, "typedef C");
+ assertTrue(typedef.getModifiers().isAbstract());
+ }
+
/**
* <p>
* http://code.google.com/p/dart/issues/detail?id=6881
« no previous file with comments | « compiler/java/com/google/dart/compiler/parser/DartParser.java ('k') | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698