| 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 5aca4965c41c0bd65b212cb317f950d591b96a27..90d9546ef77f32041b57643080706315b0c55618 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,6 +132,23 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
|
| verify(source);
|
| }
|
|
|
| + 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(
|
| + StaticWarningCode.AMBIGUOUS_IMPORT,
|
| + StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION);
|
| + }
|
| +
|
| public void test_argumentDefinitionTestNonParameter() throws Exception {
|
| Source source = addSource(createSource(//
|
| "f() {",
|
| @@ -3168,6 +3185,24 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
|
| verify(source);
|
| }
|
|
|
| + public void test_undefinedFunction() throws Exception {
|
| + Source source = addSource(createSource(//
|
| + "void f() {",
|
| + " g();",
|
| + "}"));
|
| + resolve(source);
|
| + assertErrors(CompileTimeErrorCode.UNDEFINED_FUNCTION);
|
| + }
|
| +
|
| + public void test_undefinedFunction_hasImportPrefix() throws Exception {
|
| + Source source = addSource(createSource(//
|
| + "import 'lib.dart' as f;",
|
| + "main() { return f(); }"));
|
| + addSource("/lib.dart", "library lib;");
|
| + resolve(source);
|
| + assertErrors(CompileTimeErrorCode.UNDEFINED_FUNCTION, HintCode.UNUSED_IMPORT);
|
| + }
|
| +
|
| public void test_undefinedNamedParameter() throws Exception {
|
| Source source = addSource(createSource(//
|
| "class A {",
|
|
|