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

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

Issue 17583019: Don't report INVOCATION_OF_NON_FUNCTION if variable is dynamic (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Don't use propagated type in this case Created 7 years, 6 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 75973d5fa71b867850ea0e7ce3ce34cc4a56092d..1bbe2ad53f16168fe95002569cf667ef29f8ff8d 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
@@ -1292,6 +1292,31 @@ public class NonErrorResolverTest extends ResolverTestCase {
verify(source);
}
+ public void test_invocationOfNonFunction_localVariable_dynamic() throws Exception {
+ Source source = addSource(createSource(//
+ "f() {}",
+ "main() {",
+ " var v = f;",
+ " v();",
+ "}"));
+ resolve(source);
+ assertNoErrors();
+ verify(source);
+ }
+
+ public void test_invocationOfNonFunction_localVariable_dynamic2() throws Exception {
+ Source source = addSource(createSource(//
+ "f() {}",
+ "main() {",
+ " var v = f;",
+ " v = 1;",
+ " v();",
+ "}"));
+ resolve(source);
+ assertNoErrors();
+ verify(source);
+ }
+
public void test_invocationOfNonFunction_Object() throws Exception {
Source source = addSource(createSource(//
"main() {",

Powered by Google App Engine
This is Rietveld 408576698