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

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

Issue 17586002: Resolve @Type.constructorName() and its arguments. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Resolve @A() - unnamed constructor invocation. 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/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 811b8a4ff4b50ee9048b6e66c1e4ad4d5cb91781..c55c2813ed43f4619097b233e7aaa679b4a6aee8 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
@@ -259,6 +259,32 @@ public class StaticWarningCodeTest extends ResolverTestCase {
assertErrors(StaticWarningCode.AMBIGUOUS_IMPORT);
}
+ public void test_argumentTypeNotAssignable_annotation_namedConstructor() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " A.fromInt(int p) {}",
+ "}",
+ "@A.fromInt('0')",
+ "main() {",
+ "}"));
+ resolve(source);
+ assertErrors(StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE);
+ verify(source);
+ }
+
+ public void test_argumentTypeNotAssignable_annotation_unnamedConstructor() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " A(int p) {}",
+ "}",
+ "@A('0')",
+ "main() {",
+ "}"));
+ resolve(source);
+ assertErrors(StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE);
+ verify(source);
+ }
+
public void test_argumentTypeNotAssignable_binary() throws Exception {
Source source = addSource(createSource(//
"class A {",

Powered by Google App Engine
This is Rietveld 408576698