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

Unified Diff: tests/language/super_call4_test.dart

Issue 11415287: noSuchMethod generated for super calls (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased Created 8 years 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
« no previous file with comments | « tests/language/language_dart2js.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/super_call4_test.dart
diff --git a/tests/language/super_call4_test.dart b/tests/language/super_call4_test.dart
index f5ce7c28b590d3b972c138115879fd9355bb6c54..0093bda851f2201c619593fe942af5e58f6490de 100644
--- a/tests/language/super_call4_test.dart
+++ b/tests/language/super_call4_test.dart
@@ -6,8 +6,30 @@
// current class.
class C {
+ E e = new E();
+
bool noSuchMethod(InvocationMirror im) {
- return true;
+ if (im.memberName == 'foo') {
+ return im.positionalArguments.isEmpty &&
+ im.namedArguments.isEmpty &&
+ im.invokeOn(e);
+ }
+ if (im.memberName == 'bar') {
+ return im.positionalArguments.length == 1 &&
+ im.namedArguments.isEmpty &&
+ im.invokeOn(e);
+ }
+ if (im.memberName == 'baz') {
+ return im.positionalArguments.isEmpty &&
+ im.namedArguments.length == 1 &&
+ im.invokeOn(e);
+ }
+ if (im.memberName == 'boz') {
+ return im.positionalArguments.length == 1 &&
+ im.namedArguments.length == 1 &&
+ im.invokeOn(e);
+ }
+ return false;
}
}
@@ -15,12 +37,31 @@ class D extends C {
bool noSuchMethod(InvocationMirror im) {
return false;
}
- test() {
+ test1() {
return super.foo();
}
+ test2() {
+ return super.bar(1);
+ }
+ test3() {
+ return super.baz(b: 2);
+ }
+ test4() {
+ return super.boz(1, c: 2);
+ }
+}
+
+class E {
+ bool foo() => true;
+ bool bar(int a) => a == 1;
+ bool baz({int b}) => b == 2;
+ bool boz(int a, {int c}) => a == 1 && c == 2;
}
main() {
var d = new D();
- Expect.isTrue(d.test());
+ Expect.isTrue(d.test1());
+ Expect.isTrue(d.test2());
+ Expect.isTrue(d.test3());
+ Expect.isTrue(d.test4());
}
« no previous file with comments | « tests/language/language_dart2js.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698