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

Unified Diff: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java

Issue 10441057: Issue 3248. Fix for extra interface final field warnings (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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
« no previous file with comments | « compiler/java/com/google/dart/compiler/parser/DartParser.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
diff --git a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
index 8689b3399b64f71310c7807aea17e2cae3e22195..9f5a8e2c46bf2012ac82b23b7d380505a94cfb10 100644
--- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
+++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
@@ -837,6 +837,26 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
errEx(TypeErrorCode.FIELD_IS_FINAL, 11, 5, 1));
}
+ public void test_notFinalField() throws Exception {
+ AnalyzeLibraryResult libraryResult = analyzeLibrary(
+ getName(),
+ makeCode(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "interface I default A {",
+ " var f;",
+ "}",
+ "class A implements I {",
+ " var f;",
+ "}",
+ "main() {",
+ " I a = new I();",
+ " a.f = 0;", // 6: OK, field "f" is not final
+ " a.f += 1;", // 7: OK, field "f" is not final
+ " print(a.f);", // 8: OK, can read
+ "}"));
+ assertErrors(libraryResult.getTypeErrors());
+ }
+
/**
* Test for variants of {@link DartMethodDefinition} return types.
*/
« no previous file with comments | « compiler/java/com/google/dart/compiler/parser/DartParser.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698