| Index: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
|
| diff --git a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
|
| index ebbeffd2996e36c82f21e9089c186fe6fd5ad49f..a5e35440d5347c65b71eb923c4a13c9e585ff53e 100644
|
| --- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
|
| +++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
|
| @@ -1315,16 +1315,27 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
|
| errEx(ResolverErrorCode.CANNOT_ASSIGN_TO_FINAL_ERROR, 5, 5, 1),
|
| errEx(ResolverErrorCode.CANNOT_ASSIGN_TO_FINAL_ERROR, 6, 5, 1));
|
| }
|
| -
|
| +
|
| public void test_identicalFunction() throws Exception {
|
| AnalyzeLibraryResult libraryResult = analyzeLibrary(
|
| "// filler filler filler filler filler filler filler filler filler filler",
|
| "const A = 1;",
|
| "const B = 2;",
|
| "const C = identical(A, B);",
|
| + "const D = !identical(A, B);",
|
| "");
|
| assertErrors(libraryResult.getErrors());
|
| }
|
| +
|
| + public void test_constantEvaluationException() throws Exception {
|
| + AnalyzeLibraryResult libraryResult = analyzeLibrary(
|
| + "// filler filler filler filler filler filler filler filler filler filler",
|
| + "const C = 1 ~/ 0;",
|
| + "");
|
| + assertErrors(
|
| + libraryResult.getErrors(),
|
| + errEx(ResolverErrorCode.CONSTANTS_EVALUATION_EXCEPTION, 2, 11, 6));
|
| + }
|
|
|
| /**
|
| * It is a compile-time error to use type variables in "const" instance creation.
|
| @@ -4932,6 +4943,27 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
|
| libraryResult.getErrors(),
|
| errEx(ResolverErrorCode.CONSTRUCTOR_WITH_NAME_OF_MEMBER, 3, 3, 5));
|
| }
|
| +
|
| + /**
|
| + * It is a compile-time error if M is not the name of the immediately enclosing class.
|
| + * It is a static warning if M.id is not a constructor name.
|
| + */
|
| + public void test_constructorName_factory_notEnclosingClassName() throws Exception {
|
| + AnalyzeLibraryResult libraryResult = analyzeLibrary(
|
| + "// filler filler filler filler filler filler filler filler filler filler",
|
| + "class A {}",
|
| + "class B {",
|
| + " factory A() {}",
|
| + " factory A.name() {}",
|
| + " factory B() {}",
|
| + " factory B.name() {}",
|
| + "}");
|
| + assertErrors(
|
| + libraryResult.getErrors(),
|
| + errEx(ResolverErrorCode.CONSTRUCTOR_NAME_NOT_ENCLOSING_CLASS, 4, 11, 1),
|
| + errEx(ResolverErrorCode.CONSTRUCTOR_NAME_NOT_ENCLOSING_CLASS, 5, 11, 1),
|
| + errEx(ResolverErrorCode.CONSTRUCTOR_NAME_NOT_ENCLOSING_CLASS_ID, 5, 11, 6));
|
| + }
|
|
|
| /**
|
| * <p>
|
|
|