OLD | NEW |
| 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 |
1 class Foo { | 5 class Foo { |
2 var field; | 6 var field; |
3 } | 7 } |
4 | 8 |
5 dynamic identity(x) => x; | 9 dynamic identity(x) => x; |
6 | 10 |
7 void use(x) {} | 11 void use(x) {} |
8 | 12 |
9 main(List<String> args) { | 13 main(List<String> args) { |
10 dynamic foo = identity(new Foo()); | 14 dynamic foo = identity(new Foo()); |
11 if (args.length > 1) { | 15 if (args.length > 1) { |
12 foo.field = "string"; | 16 foo.field = "string"; |
13 var first = foo.field; | 17 var first = foo.field; |
14 use(first); | 18 use(first); |
15 foo.noField = "string"; | 19 foo.noField = "string"; |
16 var second = foo.noField; | 20 var second = foo.noField; |
17 use(second); | 21 use(second); |
18 } | 22 } |
19 } | 23 } |
OLD | NEW |