OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 | |
6 // Regression test for issue 21666 - problems with method that has super calls. | 5 // Regression test for issue 21666 - problems with method that has super calls. |
7 // | 6 // |
8 // Use a method and getter with super calls in various ways. | 7 // Use a method and getter with super calls in various ways. |
9 | 8 |
10 import 'package:expect/expect.dart'; | 9 import 'package:expect/expect.dart'; |
11 | 10 |
12 @MirrorsUsed(targets: const [A, B, Object]) | 11 @MirrorsUsed(targets: const [A, B, Object]) |
13 import 'dart:mirrors'; | 12 import 'dart:mirrors'; |
14 | 13 |
15 class X { const X(); } | 14 class X { |
16 class Y { const Y(); } | 15 const X(); |
| 16 } |
| 17 |
| 18 class Y { |
| 19 const Y(); |
| 20 } |
17 | 21 |
18 typedef fInt(int x); | 22 typedef fInt(int x); |
19 typedef fString(String x); | 23 typedef fString(String x); |
20 | 24 |
21 class A { | 25 class A { |
22 @X() | 26 @X() |
23 foo(int x) => x + 1; | 27 foo(int x) => x + 1; |
24 int get bar => A.g; | 28 int get bar => A.g; |
25 | 29 |
26 static int g = 0; | 30 static int g = 0; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 var bgbar = bm.getField(#bar); | 81 var bgbar = bm.getField(#bar); |
78 | 82 |
79 Expect.equals(300, bgfoo.reflectee(2)); | 83 Expect.equals(300, bgfoo.reflectee(2)); |
80 Expect.equals(400, bm.invoke(#foo, [3]).reflectee); | 84 Expect.equals(400, bm.invoke(#foo, [3]).reflectee); |
81 Expect.equals(123000, bgbar.reflectee); | 85 Expect.equals(123000, bgbar.reflectee); |
82 Expect.isTrue(b.foo is fInt); | 86 Expect.isTrue(b.foo is fInt); |
83 Expect.isTrue(b.foo is! fString); | 87 Expect.isTrue(b.foo is! fString); |
84 Expect.isTrue(bgfoo.reflectee is fInt); | 88 Expect.isTrue(bgfoo.reflectee is fInt); |
85 Expect.isTrue(bgfoo.reflectee is! fString); | 89 Expect.isTrue(bgfoo.reflectee is! fString); |
86 } | 90 } |
OLD | NEW |