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 // Test that type inference sees the possible modification of `fisk` from | 5 // Test that type inference sees the possible modification of `fisk` from |
6 // the mirror system and not infers the value to be an integer. | 6 // the mirror system and not infers the value to be an integer. |
7 library test; | 7 library test; |
8 | 8 |
9 @MirrorsUsed(targets: 'fisk', override: '*') | 9 @MirrorsUsed(targets: 'fisk', override: '*') |
10 import 'dart:mirrors'; | 10 import 'dart:mirrors'; |
11 | 11 |
12 import 'package:expect/expect.dart'; | 12 import 'package:expect/expect.dart'; |
13 | 13 |
14 var fisk = 1; | 14 var fisk = 1; |
15 | 15 |
16 main() { | 16 main() { |
17 var lm = currentMirrorSystem().findLibrary(const Symbol('test')).single; | 17 var lm = currentMirrorSystem().findLibrary(const Symbol('test')); |
18 lm.setField(const Symbol('fisk'), 'hest'); | 18 lm.setField(const Symbol('fisk'), 'hest'); |
19 Expect.isTrue(fisk is String); | 19 Expect.isTrue(fisk is String); |
20 } | 20 } |
OLD | NEW |