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

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

Issue 38353003: Issue 13807. Support for function types promotion. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 5104e2e5dc0a0e5852e845fb2791bf4b958c9d16..8e4a7145a3ad7f428c4b670d6955a01313865741 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
@@ -2189,6 +2189,21 @@ public class StaticWarningCodeTest extends ResolverTestCase {
verify(source);
}
+ public void test_typePromotion_functionType_arg_InterToDyn() throws Exception {
+ Source source = addSource(createSource(//
+ "typedef FuncDyn(x);",
+ "typedef FuncA(A a);",
+ "class A {}",
+ "class B {}",
+ "main(FuncA f) {",
+ " if (f is FuncDyn) {", // ignored: dynamic !<< A
+ " f(new B());",
+ " }",
+ "}"));
+ resolve(source);
+ assertErrors(source, StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE);
+ }
+
public void test_typeTestNonType() throws Exception {
Source source = addSource(createSource(//
"var A = 0;",

Powered by Google App Engine
This is Rietveld 408576698