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

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

Issue 247313004: Fix for 14221/ 15553/ 16673- X isSubtypeOf E now returns false when X is some type and E is a type … (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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 81dbd21d3bc5a292fc884ebd542a35d120acc702..61fce01540cd262e2b70fa044fbf39a6904da1cf 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
@@ -264,6 +264,20 @@ public class StaticTypeWarningCodeTest extends ResolverTestCase {
verify(source);
}
+ public void test_invalidAssignment_typeParameter() throws Exception {
+ // 14221
+ Source source = addSource(createSource(//
+ "class B<T> {",
+ " T value;",
+ " void test(num n) {",
+ " value = n;",
+ " }",
+ "}"));
+ resolve(source);
+ assertErrors(source, StaticTypeWarningCode.INVALID_ASSIGNMENT);
+ verify(source);
+ }
+
public void test_invalidAssignment_variableDeclaration() throws Exception {
Source source = addSource(createSource(//
"class A {",
@@ -679,7 +693,10 @@ public class StaticTypeWarningCodeTest extends ResolverTestCase {
" factory X.name(int x, int y) = X<B>;",
"}"));
resolve(source);
- assertErrors(source, StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS);
+ assertErrors(
+ source,
+ StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS,
+ StaticWarningCode.REDIRECT_TO_INVALID_RETURN_TYPE);
verify(source);
}

Powered by Google App Engine
This is Rietveld 408576698