| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2015, 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 // Verify that instance creation expressions inside function |
| 6 // annotations are properly handled. See dartbug.com/23354 |
| 7 |
| 8 import 'dart:mirrors'; |
| 9 import 'package:expect/expect.dart'; |
| 10 |
| 11 class C { |
| 12 final String s; |
| 13 const C(this.s); |
| 14 } |
| 15 |
| 16 class D { |
| 17 final C c; |
| 18 const D(this.c); |
| 19 } |
| 20 |
| 21 @D(const C('foo')) |
| 22 f() {} |
| 23 |
| 24 main() { |
| 25 ClosureMirror closureMirror = reflect(f); |
| 26 List<InstanceMirror> metadata = closureMirror.function.metadata; |
| 27 Expect.equals(1, metadata.length); |
| 28 Expect.equals(metadata[0].reflectee.c.s, 'foo'); |
| 29 } |
| OLD | NEW |