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

Unified Diff: compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java

Issue 10695079: Another small batch of resolver tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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/javatests/com/google/dart/compiler/resolver/ResolverTest.java
diff --git a/compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java b/compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java
index cb863b89179ffe4eba5c023f6dc1dca1dce72b6b..6173f915fd6e8e6189b99a03c330686cd9b7403d 100644
--- a/compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java
+++ b/compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java
@@ -1628,4 +1628,33 @@ public class ResolverTest extends ResolverTestCase {
"}"),
errEx(ResolverErrorCode.CANNOT_CALL_FUNCTION_TYPE_ALIAS, 4, 3, 6));
}
+
+ public void test_defaultTargetInterface() throws Exception {
+ resolveAndTest(Joiner.on("\n").join(
+ "class Object {}",
+ "interface A default B {",
+ " A();",
+ "}",
+ "interface B {",
+ "}"),
+ errEx(ResolverErrorCode.DEFAULT_MUST_SPECIFY_CLASS, 2, 21, 1),
+ errEx(ResolverErrorCode.DEFAULT_CONSTRUCTOR_UNRESOLVED, 3, 3, 4));
+ }
+
+ public void test_initializerErrors() {
+ resolveAndTest(Joiner.on("\n").join(
+ "class Object {}",
+ "class A { }",
+ "class B<T> {",
+ " method() { }",
+ " B(arg) : A = 1, ",
+ " method = 2,",
+ " arg = 3,",
+ " T = 4 {}",
+ "}"),
+ errEx(ResolverErrorCode.EXPECTED_FIELD_NOT_CLASS, 5, 12, 1),
+ errEx(ResolverErrorCode.EXPECTED_FIELD_NOT_METHOD, 6, 12, 6),
+ errEx(ResolverErrorCode.EXPECTED_FIELD_NOT_PARAMETER, 7, 12, 3),
+ errEx(ResolverErrorCode.EXPECTED_FIELD_NOT_TYPE_VAR, 8, 12, 1));
+ }
}

Powered by Google App Engine
This is Rietveld 408576698