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

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

Issue 21499005: Issue 12106. Ambiguous import is now always static warning, never error. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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/CompileTimeErrorCodeTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
index d400bab1ed90503b8f7008f352adec8ebd334fcf..13f2a1b3777a147cc3ee9f90aec1633aa09180d3 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
@@ -132,159 +132,6 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
verify(source);
}
- public void test_ambiguousImport_as() throws Exception {
- Source source = addSource(createSource(//
- "import 'lib1.dart';",
- "import 'lib2.dart';",
- "f(p) {p as N;}"));
- addSource("/lib1.dart", createSource(//
- "library lib1;",
- "class N {}"));
- addSource("/lib2.dart", createSource(//
- "library lib2;",
- "class N {}"));
- resolve(source);
- assertErrors(CompileTimeErrorCode.AMBIGUOUS_IMPORT);
- }
-
- public void test_ambiguousImport_extends() throws Exception {
- Source source = addSource(createSource(//
- "import 'lib1.dart';",
- "import 'lib2.dart';",
- "class A extends N {}"));
- addSource("/lib1.dart", createSource(//
- "library lib1;",
- "class N {}"));
- addSource("/lib2.dart", createSource(//
- "library lib2;",
- "class N {}"));
- resolve(source);
- assertErrors(CompileTimeErrorCode.AMBIGUOUS_IMPORT, CompileTimeErrorCode.EXTENDS_NON_CLASS);
- }
-
- public void test_ambiguousImport_function() throws Exception {
- Source source = addSource(createSource(//
- "import 'lib1.dart';",
- "import 'lib2.dart';",
- "g() { return f(); }"));
- addSource("/lib1.dart", createSource(//
- "library lib1;",
- "f() {}"));
- addSource("/lib2.dart", createSource(//
- "library lib2;",
- "f() {}"));
- resolve(source);
- assertErrors(CompileTimeErrorCode.AMBIGUOUS_IMPORT, StaticTypeWarningCode.UNDEFINED_FUNCTION);
- }
-
- public void test_ambiguousImport_implements() throws Exception {
- Source source = addSource(createSource(//
- "import 'lib1.dart';",
- "import 'lib2.dart';",
- "class A implements N {}"));
- addSource("/lib1.dart", createSource(//
- "library lib1;",
- "class N {}"));
- addSource("/lib2.dart", createSource(//
- "library lib2;",
- "class N {}"));
- resolve(source);
- assertErrors(CompileTimeErrorCode.AMBIGUOUS_IMPORT, CompileTimeErrorCode.IMPLEMENTS_NON_CLASS);
- }
-
- public void test_ambiguousImport_instanceCreation() throws Exception {
- Source source = addSource(createSource(//
- "library L;",
- "import 'lib1.dart';",
- "import 'lib2.dart';",
- "f() {new N();}"));
- addSource("/lib1.dart", createSource(//
- "library lib1;",
- "class N {}"));
- addSource("/lib2.dart", createSource(//
- "library lib2;",
- "class N {}"));
- resolve(source);
- assertErrors(CompileTimeErrorCode.AMBIGUOUS_IMPORT);
- }
-
- public void test_ambiguousImport_is() throws Exception {
- Source source = addSource(createSource(//
- "import 'lib1.dart';",
- "import 'lib2.dart';",
- "f(p) {p is N;}"));
- addSource("/lib1.dart", createSource(//
- "library lib1;",
- "class N {}"));
- addSource("/lib2.dart", createSource(//
- "library lib2;",
- "class N {}"));
- resolve(source);
- assertErrors(CompileTimeErrorCode.AMBIGUOUS_IMPORT);
- }
-
- public void test_ambiguousImport_qualifier() throws Exception {
- Source source = addSource(createSource(//
- "import 'lib1.dart';",
- "import 'lib2.dart';",
- "g() { N.FOO; }"));
- addSource("/lib1.dart", createSource(//
- "library lib1;",
- "class N {}"));
- addSource("/lib2.dart", createSource(//
- "library lib2;",
- "class N {}"));
- resolve(source);
- assertErrors(CompileTimeErrorCode.AMBIGUOUS_IMPORT);
- }
-
- public void test_ambiguousImport_typeArgument_instanceCreation() throws Exception {
- Source source = addSource(createSource(//
- "import 'lib1.dart';",
- "import 'lib2.dart';",
- "class A<T> {}",
- "f() {new A<N>();}"));
- addSource("/lib1.dart", createSource(//
- "library lib1;",
- "class N {}"));
- addSource("/lib2.dart", createSource(//
- "library lib2;",
- "class N {}"));
- resolve(source);
- assertErrors(CompileTimeErrorCode.AMBIGUOUS_IMPORT);
- }
-
- public void test_ambiguousImport_varRead() throws Exception {
- Source source = addSource(createSource(//
- "import 'lib1.dart';",
- "import 'lib2.dart';",
- "f() { g(v); }",
- "g(p) {}"));
- addSource("/lib1.dart", createSource(//
- "library lib1;",
- "var v;"));
- addSource("/lib2.dart", createSource(//
- "library lib2;",
- "var v;"));
- resolve(source);
- assertErrors(CompileTimeErrorCode.AMBIGUOUS_IMPORT);
- }
-
- public void test_ambiguousImport_varWrite() throws Exception {
- Source source = addSource(createSource(//
- "import 'lib1.dart';",
- "import 'lib2.dart';",
- "f() { v = 0; }"));
- addSource("/lib1.dart", createSource(//
- "library lib1;",
- "var v;"));
- addSource("/lib2.dart", createSource(//
- "library lib2;",
- "var v;"));
- resolve(source);
- assertErrors(CompileTimeErrorCode.AMBIGUOUS_IMPORT);
- }
-
public void test_argumentDefinitionTestNonParameter() throws Exception {
Source source = addSource(createSource(//
"f() {",

Powered by Google App Engine
This is Rietveld 408576698