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

Unified Diff: tests/compiler/dart2js/cpa_inference_test.dart

Issue 11412148: Fix handling of sends with wrong arity (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address Karl's comments Created 8 years, 1 month 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: tests/compiler/dart2js/cpa_inference_test.dart
diff --git a/tests/compiler/dart2js/cpa_inference_test.dart b/tests/compiler/dart2js/cpa_inference_test.dart
index a8db3d513305e96e2cd3c225c143ef7157e2eaf3..8e059fecdb4bb5ed8abc7ad1d01c3b1d25802dda 100644
--- a/tests/compiler/dart2js/cpa_inference_test.dart
+++ b/tests/compiler/dart2js/cpa_inference_test.dart
@@ -588,6 +588,25 @@ testFieldInitialization() {
result.checkFieldHasType('A', 'y', [result.int]);
}
+testSendWithWrongArity() {
+ final String source = r"""
+ f(x) { }
+ class A { g(x) { } }
+ main () {
+ var x = f();
+ var y = f(1, 2);
+ var z = new A().g();
+ var w = new A().g(1, 2);
+ x; y; z; w;
+ }
+ """;
+ AnalysisResult result = analyze(source);
+ result.checkNodeHasType('x', []);
+ result.checkNodeHasType('y', []);
+ result.checkNodeHasType('z', []);
+ result.checkNodeHasType('w', []);
+}
+
void main() {
testLiterals();
testRedefinition();
@@ -614,4 +633,5 @@ void main() {
testCompoundOperators1();
testCompoundOperators2();
// testFieldInitialization(); // TODO(polux)
+ testSendWithWrongArity();
}

Powered by Google App Engine
This is Rietveld 408576698