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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/language/language_dart2js.status ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // Checks that noSuchMethod is resolved in the super class and not in the 5 // Checks that noSuchMethod is resolved in the super class and not in the
6 // current class. 6 // current class.
7 7
8 class C { 8 class C {
9 E e = new E();
10
9 bool noSuchMethod(InvocationMirror im) { 11 bool noSuchMethod(InvocationMirror im) {
10 return true; 12 if (im.memberName == 'foo') {
13 return im.positionalArguments.isEmpty &&
14 im.namedArguments.isEmpty &&
15 im.invokeOn(e);
16 }
17 if (im.memberName == 'bar') {
18 return im.positionalArguments.length == 1 &&
19 im.namedArguments.isEmpty &&
20 im.invokeOn(e);
21 }
22 if (im.memberName == 'baz') {
23 return im.positionalArguments.isEmpty &&
24 im.namedArguments.length == 1 &&
25 im.invokeOn(e);
26 }
27 if (im.memberName == 'boz') {
28 return im.positionalArguments.length == 1 &&
29 im.namedArguments.length == 1 &&
30 im.invokeOn(e);
31 }
32 return false;
11 } 33 }
12 } 34 }
13 35
14 class D extends C { 36 class D extends C {
15 bool noSuchMethod(InvocationMirror im) { 37 bool noSuchMethod(InvocationMirror im) {
16 return false; 38 return false;
17 } 39 }
18 test() { 40 test1() {
19 return super.foo(); 41 return super.foo();
20 } 42 }
43 test2() {
44 return super.bar(1);
45 }
46 test3() {
47 return super.baz(b: 2);
48 }
49 test4() {
50 return super.boz(1, c: 2);
51 }
52 }
53
54 class E {
55 bool foo() => true;
56 bool bar(int a) => a == 1;
57 bool baz({int b}) => b == 2;
58 bool boz(int a, {int c}) => a == 1 && c == 2;
21 } 59 }
22 60
23 main() { 61 main() {
24 var d = new D(); 62 var d = new D();
25 Expect.isTrue(d.test()); 63 Expect.isTrue(d.test1());
64 Expect.isTrue(d.test2());
65 Expect.isTrue(d.test3());
66 Expect.isTrue(d.test4());
26 } 67 }
OLDNEW
« 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