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

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

Issue 9168020: Issue 985: Default class without constructor does not cause a compile-time error (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Nits Created 8 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/javatests/com/google/dart/compiler/resolver/NegativeResolverTest.java
diff --git a/compiler/javatests/com/google/dart/compiler/resolver/NegativeResolverTest.java b/compiler/javatests/com/google/dart/compiler/resolver/NegativeResolverTest.java
index 59acbc7b0f5877e1bca03e831b0f75bc0754d178..7ad7fb966e3f6d3f2c09be010b25e7923be945f6 100644
--- a/compiler/javatests/com/google/dart/compiler/resolver/NegativeResolverTest.java
+++ b/compiler/javatests/com/google/dart/compiler/resolver/NegativeResolverTest.java
@@ -1099,16 +1099,26 @@ public class NegativeResolverTest extends CompilerTestCase {
}
public void testInitializerReferenceToThis() throws Exception {
- checkSourceErrors(
- makeCode(
- "class A {",
- " var x, y;",
- " A.one(z) : x = z, y = this.x;",
- " A.two(this.x) : y = (() { return this; });",
- " A.three(this.x) : y = this.x;",
- "}"),
- errEx(ResolverErrorCode.THIS_IN_INITIALIZER_AS_EXPRESSION, 3, 25, 4),
- errEx(ResolverErrorCode.THIS_IN_INITIALIZER_AS_EXPRESSION, 4, 36, 4),
- errEx(ResolverErrorCode.THIS_IN_INITIALIZER_AS_EXPRESSION, 5, 25, 4));
- }
+ checkSourceErrors(
+ makeCode(
+ "class A {",
+ " var x, y;",
+ " A.one(z) : x = z, y = this.x;",
+ " A.two(this.x) : y = (() { return this; });",
+ " A.three(this.x) : y = this.x;",
+ "}"),
+ errEx(ResolverErrorCode.THIS_IN_INITIALIZER_AS_EXPRESSION, 3, 25, 4),
+ errEx(ResolverErrorCode.THIS_IN_INITIALIZER_AS_EXPRESSION, 4, 36, 4),
+ errEx(ResolverErrorCode.THIS_IN_INITIALIZER_AS_EXPRESSION, 5, 25, 4));
+ }
+
+ public void testInterfaceWithConcreteConstructorAndDefaultNonImlplementing() throws Exception {
+ checkSourceErrors(
+ makeCode(
+ "class A {}",
+ "interface I default A {",
+ " I();",
+ "}"),
+ errEx(ResolverErrorCode.DEFAULT_CONSTRUCTOR_UNRESOLVED, 3, 3, 4));
+ }
}

Powered by Google App Engine
This is Rietveld 408576698