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

Side by Side Diff: dart/tests/compiler/dart2js_extra/mirror_type_inference_field2_test.dart

Issue 23455028: Mirrors overhaul. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merged with r29550. Created 7 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 | Annotate | Revision Log
OLDNEW
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, or any 6 // the mirror system and not infers the value to be an integer, or any
7 // other elements that use `fisk` like `otherFisk` to be of type integer. 7 // other elements that use `fisk` like `otherFisk` to be of type integer.
8 library test; 8 library test;
9 9
10 @MirrorsUsed(targets: 'fisk', override: '*') 10 @MirrorsUsed(targets: 'fisk', override: '*')
11 import 'dart:mirrors'; 11 import 'dart:mirrors';
12 12
13 import 'package:expect/expect.dart'; 13 import 'package:expect/expect.dart';
14 14
15 var fisk = 1; 15 var fisk = 1;
16 var otherFisk = 42; 16 var otherFisk = 42;
17 17
18 main() { 18 main() {
19 var lm = currentMirrorSystem().findLibrary(const Symbol('test')).single; 19 var lm = currentMirrorSystem().findLibrary(const Symbol('test'));
20 lm.setField(const Symbol('fisk'), 'hest'); 20 lm.setField(const Symbol('fisk'), 'hest');
21 otherFisk = fisk; 21 otherFisk = fisk;
22 Expect.isTrue(otherFisk is String); 22 Expect.isTrue(otherFisk is String);
23 } 23 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698