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

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

Issue 283213002: Fix for analyzer, 18562, warning for deferred types is now generated on type tests, casts and catch… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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/DeferredLoadingTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/DeferredLoadingTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/DeferredLoadingTest.java
index 03d5ed09e3125199799b77b049e5ca082e379de5..d3928557a2cdf33d59948053660cc4fd1afc4abc 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/DeferredLoadingTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/DeferredLoadingTest.java
@@ -531,6 +531,38 @@ public class DeferredLoadingTest extends ResolverTestCase {
verify(source);
}
+ public void test_typeAnnotationDeferredClass_asExpression() throws Exception {
+ addNamedSource("/lib1.dart", createSource(//
+ "library lib1;",
+ "class A {}"));
+ Source source = addSource(createSource(//
+ "library root;",
+ "import 'lib1.dart' deferred as a;",
+ "f(var v) {",
+ " v as a.A;",
+ "}"));
+ resolve(source);
+ assertErrors(source, StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS);
+ verify(source);
+ }
+
+ public void test_typeAnnotationDeferredClass_catchClause() throws Exception {
+ addNamedSource("/lib1.dart", createSource(//
+ "library lib1;",
+ "class A {}"));
+ Source source = addSource(createSource(//
+ "library root;",
+ "import 'lib1.dart' deferred as a;",
+ "f(var v) {",
+ " try {",
+ " } on a.A {",
+ " }",
+ "}"));
+ resolve(source);
+ assertErrors(source, StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS);
+ verify(source);
+ }
+
public void test_typeAnnotationDeferredClass_fieldFormalParameter() throws Exception {
addNamedSource("/lib1.dart", createSource(//
"library lib1;",
@@ -574,6 +606,21 @@ public class DeferredLoadingTest extends ResolverTestCase {
verify(source);
}
+ public void test_typeAnnotationDeferredClass_isExpression() throws Exception {
+ addNamedSource("/lib1.dart", createSource(//
+ "library lib1;",
+ "class A {}"));
+ Source source = addSource(createSource(//
+ "library root;",
+ "import 'lib1.dart' deferred as a;",
+ "f(var v) {",
+ " bool b = v is a.A;",
+ "}"));
+ resolve(source);
+ assertErrors(source, StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS);
+ verify(source);
+ }
+
public void test_typeAnnotationDeferredClass_methodDeclaration_returnType() throws Exception {
addNamedSource("/lib1.dart", createSource(//
"library lib1;",

Powered by Google App Engine
This is Rietveld 408576698