| 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 ba792eafe55a86cfe3a812e5ef5fd21401c41322..428b73617ab9af9736c79e690595a2f2e8e1cffa 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
|
| @@ -339,6 +339,32 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
|
| verify(source);
|
| }
|
|
|
| + public void test_argumentTypeNotAssignable_const() throws Exception {
|
| + Source source = addSource(createSource(//
|
| + "class A {",
|
| + " const A(String p);",
|
| + "}",
|
| + "main() {",
|
| + " const A(42);",
|
| + "}"));
|
| + resolve(source);
|
| + assertErrors(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE);
|
| + verify(source);
|
| + }
|
| +
|
| + public void test_argumentTypeNotAssignable_const_super() throws Exception {
|
| + Source source = addSource(createSource(//
|
| + "class A {",
|
| + " const A(String p);",
|
| + "}",
|
| + "class B extends A {",
|
| + " const B() : super(42);",
|
| + "}"));
|
| + resolve(source);
|
| + assertErrors(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE);
|
| + verify(source);
|
| + }
|
| +
|
| public void test_builtInIdentifierAsType() throws Exception {
|
| Source source = addSource(createSource(//
|
| "f() {",
|
| @@ -1178,6 +1204,19 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
|
| verify(source);
|
| }
|
|
|
| + public void test_extraPositionalArguments_const_super() throws Exception {
|
| + Source source = addSource(createSource(//
|
| + "class A {",
|
| + " const A();",
|
| + "}",
|
| + "class B extends A {",
|
| + " const B() : super(0);",
|
| + "}"));
|
| + resolve(source);
|
| + assertErrors(CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS);
|
| + verify(source);
|
| + }
|
| +
|
| public void test_fieldInitializedByMultipleInitializers() throws Exception {
|
| Source source = addSource(createSource(//
|
| "class A {",
|
| @@ -2483,7 +2522,7 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
|
| resolve(source);
|
| assertErrors(
|
| CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER,
|
| - StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE);
|
| + CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE);
|
| verify(source);
|
| }
|
|
|
| @@ -2496,7 +2535,7 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
|
| resolve(source);
|
| assertErrors(
|
| CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER,
|
| - StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE);
|
| + CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE);
|
| verify(source);
|
| }
|
|
|
| @@ -2589,6 +2628,19 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
|
| verify(source);
|
| }
|
|
|
| + public void test_notEnoughRequiredArguments_const_super() throws Exception {
|
| + Source source = addSource(createSource(//
|
| + "class A {",
|
| + " const A(int p);",
|
| + "}",
|
| + "class B extends A {",
|
| + " const B() : super();",
|
| + "}"));
|
| + resolve(source);
|
| + assertErrors(CompileTimeErrorCode.NOT_ENOUGH_REQUIRED_ARGUMENTS);
|
| + verify(source);
|
| + }
|
| +
|
| public void test_optionalParameterInOperator_named() throws Exception {
|
| Source source = addSource(createSource(//
|
| "class A {",
|
| @@ -3397,7 +3449,7 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
|
| resolve(source);
|
| assertErrors(
|
| CompileTimeErrorCode.CONST_EVAL_TYPE_INT,
|
| - StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE);
|
| + CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE);
|
| verify(source);
|
| reset();
|
| }
|
| @@ -3411,7 +3463,7 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
|
| resolve(source);
|
| assertErrors(
|
| CompileTimeErrorCode.CONST_EVAL_TYPE_NUM,
|
| - StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE);
|
| + CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE);
|
| verify(source);
|
| reset();
|
| }
|
|
|