| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 library test.constructor_kinds_test; | 5 library test.constructor_kinds_test; |
| 6 | 6 |
| 7 @MirrorsUsed(targets: "test.constructor_kinds_test") |
| 7 import 'dart:mirrors'; | 8 import 'dart:mirrors'; |
| 8 import 'package:expect/expect.dart'; | 9 import 'package:expect/expect.dart'; |
| 9 | 10 |
| 10 class ClassWithDefaultConstructor {} | 11 class ClassWithDefaultConstructor {} |
| 11 | 12 |
| 12 class Class { | 13 class Class { |
| 13 Class.generativeConstructor(); | 14 Class.generativeConstructor(); |
| 14 Class.redirectingGenerativeConstructor() : this.generativeConstructor(); | 15 Class.redirectingGenerativeConstructor() : this.generativeConstructor(); |
| 15 factory Class.factoryConstructor() => new Class.generativeConstructor(); | 16 factory Class.factoryConstructor() => new Class.generativeConstructor(); |
| 16 factory Class.redirectingFactoryConstructor() = Class.factoryConstructor; | 17 factory Class.redirectingFactoryConstructor() = Class.factoryConstructor; |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 // Expect.isFalse(mm.isRedirectingConstructor); | 103 // Expect.isFalse(mm.isRedirectingConstructor); |
| 103 // Expect.isTrue(mm.isConstConstructor); | 104 // Expect.isTrue(mm.isConstConstructor); |
| 104 | 105 |
| 105 mm = cm.declarations[#Class.constRedirectingFactoryConstructor]; | 106 mm = cm.declarations[#Class.constRedirectingFactoryConstructor]; |
| 106 Expect.isTrue(mm.isConstructor); | 107 Expect.isTrue(mm.isConstructor); |
| 107 Expect.isFalse(mm.isGenerativeConstructor); | 108 Expect.isFalse(mm.isGenerativeConstructor); |
| 108 Expect.isTrue(mm.isFactoryConstructor); | 109 Expect.isTrue(mm.isFactoryConstructor); |
| 109 Expect.isTrue(mm.isRedirectingConstructor); | 110 Expect.isTrue(mm.isRedirectingConstructor); |
| 110 Expect.isTrue(mm.isConstConstructor); | 111 Expect.isTrue(mm.isConstConstructor); |
| 111 } | 112 } |
| OLD | NEW |