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

Side by Side Diff: tests/lib_strong/mirrors/field_metadata_test.dart

Issue 2861503002: fix #29530, field metadata generation (Closed)
Patch Set: wip Created 3 years, 7 months 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
« no previous file with comments | « tests/lib_strong/mirrors/field_metadata2_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2017, 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 import 'dart:mirrors';
6 import 'package:expect/expect.dart';
7
8 class Bar {
9 final String name;
10
11 const Bar(this.name);
12 }
13
14 class Foo {
15 @Bar('bar')
16 int x = 40;
17
18 @Bar('baz')
19 final String y = 'hi';
20 }
21
22 void main() {
23 dynamic f = new Foo();
24 Expect.throws(() {
25 f.x = 'hello';
26 });
27 f.x += 2;
28 Expect.equals(f.x, 42);
29 Expect.equals(f.y, 'hi');
30
31 var members = reflect(f).type.declarations;
32 var x = members[#x] as VariableMirror;
33 var y = members[#y] as VariableMirror;
34 Expect.equals(x.type.simpleName, #int);
35 Expect.equals(y.type.simpleName, #String);
36 }
OLDNEW
« no previous file with comments | « tests/lib_strong/mirrors/field_metadata2_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698