Index: tests/compiler/dart2js/resolver_test.dart |
=================================================================== |
--- tests/compiler/dart2js/resolver_test.dart (revision 26191) |
+++ tests/compiler/dart2js/resolver_test.dart (working copy) |
@@ -76,6 +76,7 @@ |
testIncrementsAndDecrements(); |
testOverrideHashCodeCheck(); |
testSupertypeOrder(); |
+ testConstructorArgumentMismatch(); |
} |
testSupertypeOrder() { |
@@ -575,6 +576,20 @@ |
Expect.isTrue(element.isSynthesized); |
} |
+testConstructorArgumentMismatch() { |
+ String script = "class A {} foo() { print(new A(42)); }"; |
+ MockCompiler compiler = new MockCompiler(); |
+ compiler.parseScript(script); |
+ FunctionElement fooElement = compiler.mainApp.find(buildSourceString('foo')); |
+ Expect.isNotNull(fooElement); |
+ fooElement.parseNode(compiler); |
+ compiler.resolver.resolve(fooElement); |
+ |
+ compareWarningKinds( |
+ script, [MessageKind.INVALID_ARGUMENTS.warning], compiler.warnings); |
+ compareWarningKinds(script, [], compiler.errors); |
+} |
+ |
testTopLevelFields() { |
MockCompiler compiler = new MockCompiler(); |
compiler.parseScript("int a;"); |