OLD | NEW |
| (Empty) |
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 | |
3 // BSD-style license that can be found in the LICENSE file. | |
4 | |
5 // Regression test for dart2js bug http://dartbug.com/11570. | |
6 | |
7 import 'package:expect/expect.dart'; | |
8 | |
9 void main() { | |
10 var c = new Cool(true); | |
11 Expect.stringEquals('{}', '${c.thing}'); | |
12 | |
13 c = new Cool(false); | |
14 Expect.stringEquals('[]', '${c.thing}'); | |
15 | |
16 c = new Cool.alt(true); | |
17 Expect.stringEquals('{}', '${c.thing}'); | |
18 | |
19 c = new Cool.alt(false); | |
20 Expect.stringEquals('[]', '${c.thing}'); | |
21 } | |
22 | |
23 class Cool { | |
24 final thing; | |
25 | |
26 Cool(bool option) : thing = option ? <String, String>{} : <String>[]; | |
27 Cool.alt(bool option) : thing = !option ? <String>[] : <String, String>{}; | |
28 } | |
OLD | NEW |