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

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

Issue 18051016: Do report StaticWarningCode.FINAL_NOT_INITIALIZED (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Don't report for native classes Created 7 years, 5 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/NonErrorResolverTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java
index e36ba73e75ea38b2779e8c29a3481278195a36cc..9351ec93955e51212b22254d4c902d0fd783dd5e 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java
@@ -747,6 +747,38 @@ public class NonErrorResolverTest extends ResolverTestCase {
verify(source);
}
+ public void test_finalNotInitialized_functionTypedFieldFormal() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " final Function x;",
+ " A(int this.x(int p)) {}",
+ "}"));
+ resolve(source);
+ assertNoErrors();
+ verify(source);
+ }
+
+ public void test_finalNotInitialized_hasNativeClause_hasConstructor() throws Exception {
+ Source source = addSource(createSource(//
+ "class A native 'something' {",
+ " final int x;",
+ " A() {}",
+ "}"));
+ resolve(source);
+ assertNoErrors();
+ verify(source);
+ }
+
+ public void test_finalNotInitialized_hasNativeClause_noConstructor() throws Exception {
+ Source source = addSource(createSource(//
+ "class A native 'something' {",
+ " final int x;",
+ "}"));
+ resolve(source);
+ assertNoErrors();
+ verify(source);
+ }
+
public void test_finalNotInitialized_initializer() throws Exception {
Source source = addSource(createSource(//
"class A {",
@@ -758,6 +790,18 @@ public class NonErrorResolverTest extends ResolverTestCase {
verify(source);
}
+ public void test_finalNotInitialized_redirectingConstructor() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " final int x;",
+ " A(this.x);",
+ " A.named() : this (42);",
+ "}"));
+ resolve(source);
+ assertNoErrors();
+ verify(source);
+ }
+
public void test_implicitThisReferenceInInitializer_constructorName() throws Exception {
Source source = addSource(createSource(//
"class A {",

Powered by Google App Engine
This is Rietveld 408576698