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

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

Issue 10690074: Migrates some resolver errors to parser stage (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 6173f915fd6e8e6189b99a03c330686cd9b7403d..ada4274d2c651bf53a4a1eaf67e46f3c724c0988 100644
--- a/compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java
+++ b/compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java
@@ -572,6 +572,15 @@ public class ResolverTest extends ResolverTestCase {
ResolverErrorCode.TYPE_PARAMETERS_MUST_MATCH_EXACTLY);
}
+ public void test_constFactory() throws Exception {
+ resolveAndTest(Joiner.on("\n").join(
+ "class Object {}",
+ "class A {",
+ " const factory A() { }",
+ "}"),
+ errEx(ResolverErrorCode.FACTORY_CANNOT_BE_CONST, 3, 17, 1));
+ }
+
public void testFactoryBadTypeArgs11() {
// Invoke constructor in factory method with (wrong) type args
resolveAndTest(Joiner.on("\n").join(
@@ -597,6 +606,7 @@ public class ResolverTest extends ResolverTestCase {
"}"),
ResolverErrorCode.DEFAULT_CLASS_MUST_HAVE_SAME_TYPE_PARAMS);
}
+
public void testBadDefaultTypeArgs11() {
// Example from spec v0.6
resolveAndTest(Joiner.on("\n").join(
@@ -1628,33 +1638,4 @@ 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