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

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

Issue 24191008: Report CTEC.CONST_NOT_INITIALIZED (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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 6fd1ee590e51697ee42e94967f0938e4ba5bbdcc..ea730578c0493c7bee0affe417abed0a6535ad8f 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
@@ -1294,6 +1294,34 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
verify(source);
}
+ public void test_finalNotInitialized_instanceField_const_static() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " static const F;",
+ "}"));
+ resolve(source);
+ assertErrors(source, CompileTimeErrorCode.CONST_NOT_INITIALIZED);
+ verify(source);
+ }
+
+ public void test_finalNotInitialized_library_const() throws Exception {
+ Source source = addSource(createSource(//
+ "const F;"));
+ resolve(source);
+ assertErrors(source, CompileTimeErrorCode.CONST_NOT_INITIALIZED);
+ verify(source);
+ }
+
+ public void test_finalNotInitialized_local_const() throws Exception {
+ Source source = addSource(createSource(//
+ "f() {",
+ " const int x;",
+ "}"));
+ resolve(source);
+ assertErrors(source, CompileTimeErrorCode.CONST_NOT_INITIALIZED);
+ verify(source);
+ }
+
public void test_getterAndMethodWithSameName() throws Exception {
Source source = addSource(createSource(//
"class A {",

Powered by Google App Engine
This is Rietveld 408576698