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

Unified Diff: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java

Issue 23216006: Rules for finals were loosened, contradiction in spec was fixed. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
index 79a02ee133f72c95c318a598f185099937fc4eb5..a5706ccb0dbce1b8ae066d9554785667c2ba9dfb 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
@@ -1124,17 +1124,6 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
verify(source);
}
- public void test_fieldInitializedInInitializerAndDeclaration_final() throws Exception {
- Source source = addSource(createSource(//
- "class A {",
- " final int x = 0;",
- " A() : x = 1 {}",
- "}"));
- resolve(source);
- assertErrors(CompileTimeErrorCode.FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION);
- verify(source);
- }
-
public void test_fieldInitializedInParameterAndInitializer() throws Exception {
Source source = addSource(createSource(//
"class A {",
@@ -1229,38 +1218,6 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
verify(source);
}
- /**
- * This test doesn't test the FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR code, but tests the
- * FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION code instead. It is provided here to show
- * coverage over all of the permutations of initializers in constructor declarations.
- * <p>
- * Note: FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION covers a subset of
- * FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR, since it more specific, we use it instead of
- * the broader code
- */
- public void test_finalInitializedInDeclarationAndConstructor_initializers() throws Exception {
- Source source = addSource(createSource(//
- "class A {",
- " final x = 0;",
- " A() : x = 0 {}",
- "}"));
- resolve(source);
- assertErrors(CompileTimeErrorCode.FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION);
- verify(source);
- }
-
- public void test_finalInitializedInDeclarationAndConstructor_initializingFormal()
- throws Exception {
- Source source = addSource(createSource(//
- "class A {",
- " final x = 0;",
- " A(this.x) {}",
- "}"));
- resolve(source);
- assertErrors(CompileTimeErrorCode.FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR);
- verify(source);
- }
-
public void test_finalInitializedMultipleTimes_initializers() throws Exception {
Source source = addSource(createSource(//
"class A {",

Powered by Google App Engine
This is Rietveld 408576698