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

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

Issue 9166006: Issue 1105: Duplicate initialization should have a compile error (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Nit 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 85e5240710eb20d89e07fe1e1cdee5269e845a02..f98483b1baf2fd04e0a0df174941fa19817f31bb 100644
--- a/compiler/javatests/com/google/dart/compiler/resolver/NegativeResolverTest.java
+++ b/compiler/javatests/com/google/dart/compiler/resolver/NegativeResolverTest.java
@@ -1074,4 +1074,16 @@ public class NegativeResolverTest extends CompilerTestCase {
"class MyClass implements Map<Object, Dynamic> {",
"}"));
}
+
+ public void testConstructorDuplicateInitializationTest() {
+ checkSourceErrors(
+ makeCode(
+ "class A {",
+ " A.one(this.x) : this.x = 42;",
+ " A.two(y) : this.x = y, x = y;",
+ " var x;",
+ "}"),
+ errEx(ResolverErrorCode.DUPLICATE_INITIALIZATION, 2, 19, 11),
+ errEx(ResolverErrorCode.DUPLICATE_INITIALIZATION, 3, 26, 5));
+ }
}
« no previous file with comments | « compiler/java/com/google/dart/compiler/resolver/ResolverErrorCode.java ('k') | tests/co19/co19-compiler.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698