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/StaticWarningCodeTest.java

Issue 16113003: Report SWC. and CTEC.CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add comment Created 7 years, 7 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/StaticWarningCodeTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java
index 3d70358c6fcc95c03f5be0ade2aa49fee1c032a9..4a2e1cf0711a0ae26f5eabd7786c62ac6041bf16 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java
@@ -591,14 +591,25 @@ public class StaticWarningCodeTest extends ResolverTestCase {
verify(source);
}
- public void test_fieldInitializerWithInvalidType() throws Exception {
+ public void test_fieldInitializerNotAssignable() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " int x;",
+ " A() : x = '';",
+ "}"));
+ resolve(source);
+ assertErrors(StaticWarningCode.FIELD_INITIALIZER_NOT_ASSIGNABLE);
+ verify(source);
+ }
+
+ public void test_fieldInitializingFormalNotAssignable() throws Exception {
Source source = addSource(createSource(//
"class A {",
" int x;",
" A(String this.x) {}",
"}"));
resolve(source);
- assertErrors(StaticWarningCode.FIELD_INITIALIZER_WITH_INVALID_TYPE);
+ assertErrors(StaticWarningCode.FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE);
verify(source);
}

Powered by Google App Engine
This is Rietveld 408576698