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

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

Issue 17085003: Implement new error code: StaticTypeWarningCode.NON_TYPE_AS_TYPE_ARGUMENT (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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/StaticTypeWarningCodeTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticTypeWarningCodeTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticTypeWarningCodeTest.java
index e8502b10166ad386b3ca4de906a6893aa6c81e45..de00d2a56318eea2f0b298d1ff0d94b3dd5110ae 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticTypeWarningCodeTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticTypeWarningCodeTest.java
@@ -26,16 +26,6 @@ public class StaticTypeWarningCodeTest extends ResolverTestCase {
verify(source);
}
- public void fail_nonTypeAsTypeArgument() throws Exception {
- Source source = addSource(createSource(//
- "int A;",
- "class B<E> {}",
- "f(B<A> b) {}"));
- resolve(source);
- assertErrors(StaticTypeWarningCode.NON_TYPE_AS_TYPE_ARGUMENT);
- verify(source);
- }
-
public void fail_redirectWithInvalidTypeParameters() throws Exception {
Source source = addSource(createSource(//
// TODO
@@ -268,6 +258,25 @@ public class StaticTypeWarningCodeTest extends ResolverTestCase {
verify(source);
}
+ public void test_nonTypeAsTypeArgument_notAType() throws Exception {
+ Source source = addSource(createSource(//
+ "int A;",
+ "class B<E> {}",
+ "f(B<A> b) {}"));
+ resolve(source);
+ assertErrors(StaticTypeWarningCode.NON_TYPE_AS_TYPE_ARGUMENT);
+ verify(source);
+ }
+
+ public void test_nonTypeAsTypeArgument_undefinedIdentifier() throws Exception {
+ Source source = addSource(createSource(//
+ "class B<E> {}",
+ "f(B<A> b) {}"));
+ resolve(source);
+ assertErrors(StaticTypeWarningCode.NON_TYPE_AS_TYPE_ARGUMENT);
+ verify(source);
+ }
+
public void test_returnOfInvalidType_expressionFunctionBody_function() throws Exception {
Source source = addSource(createSource(//
"int f() => '0';"));

Powered by Google App Engine
This is Rietveld 408576698