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

Side by Side Diff: tests/kernel/unsorted/superclass_test.dart

Issue 2451623006: Reland "Merge more Kernel infrastructure from kernel_sdk SDK fork." (Closed)
Patch Set: Fix Created 4 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 unified diff | Download patch
« no previous file with comments | « tests/kernel/unsorted/super_test.dart ('k') | tests/kernel/unsorted/switch_case_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
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.
4
5 import 'expect.dart';
6
7 class A {
8 A() {
9 print("A");
10 }
11
12 hello() {
13 print("A.hello()");
14 return 1;
15 }
16
17 hello1(a) {
18 print("A.hello1()");
19 print(a);
20 return 1;
21 }
22
23 foo(a, [b]) {
24 print("A.foo()");
25 print(a);
26 print(b);
27 return 1;
28 }
29
30 bar(a, {b}) {
31 print("A.bar()");
32 print(a);
33 print(b);
34 return 1;
35 }
36 }
37
38 class B extends A {
39 hello() {
40 print("B.hello()");
41 return 2;
42 }
43
44 bar(a, {b}) {
45 print("B.bar()");
46 print(a);
47 print(b);
48 return 2;
49 }
50 }
51
52 main() {
53 var o = new B();
54
55 // Base class methods.
56 Expect.isTrue(o.hello1(1) == 1);
57 Expect.isTrue(o.foo(1) == 1);
58 Expect.isTrue(o.foo(1, 2) == 1);
59
60 // Overwritten methods.
61 Expect.isTrue(o.hello() == 2);
62 Expect.isTrue(o.bar(1) == 2);
63 Expect.isTrue(o.bar(1, b: 2) == 2);
64 }
OLDNEW
« no previous file with comments | « tests/kernel/unsorted/super_test.dart ('k') | tests/kernel/unsorted/switch_case_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698