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

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

Issue 10827127: Issue 4315. Fix for type of cascade assignment (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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
« no previous file with comments | « compiler/java/com/google/dart/compiler/type/TypeAnalyzer.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 65b4c8d428b006ab353ff5020afde52a6937086a..6e1794ced91fd8b5975feab6ac2b86581472a9ad 100644
--- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
+++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
@@ -3225,7 +3225,7 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
errEx(ParserErrorCode.EXTERNAL_ONLY_METHOD, 5, 16, 6),
errEx(ParserErrorCode.EXTERNAL_ONLY_METHOD, 6, 16, 6));
}
-
+
/**
* Methods with "external" cannot have body.
*/
@@ -3249,6 +3249,46 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
errEx(ParserErrorCode.EXTERNAL_ABSTRACT, 7, 12, 8));
}
+ /**
+ * <p>
+ * http://code.google.com/p/dart/issues/detail?id=4315
+ */
+ public void test_cascade_propertyAccess() throws Exception {
+ AnalyzeLibraryResult libraryResult = analyzeLibrary(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "class A {",
+ " int f;",
+ "}",
+ "main() {",
+ " A a = new A();",
+ " a",
+ " ..f = 1",
+ " ..f = 2;",
+ "}",
+ "");
+ assertErrors(libraryResult.getErrors());
+ }
+
+ /**
+ * <p>
+ * http://code.google.com/p/dart/issues/detail?id=4315
+ */
+ public void test_cascade_methodInvocation() throws Exception {
+ AnalyzeLibraryResult libraryResult = analyzeLibrary(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "class A {",
+ " int m() {}",
+ "}",
+ "main() {",
+ " A a = new A();",
+ " a",
+ " ..m()",
+ " ..m();",
+ "}",
+ "");
+ assertErrors(libraryResult.getErrors());
+ }
+
private static <T extends DartNode> T findNode(
AnalyzeLibraryResult libraryResult,
final Class<T> clazz,
« no previous file with comments | « compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698