OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2014, 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 library lib1; |
| 6 |
| 7 class ConstClass { |
| 8 final x; |
| 9 const ConstClass(this.x); |
| 10 } |
| 11 |
| 12 var x = const ConstClass(const ConstClass(1)); |
| 13 |
| 14 class C { |
| 15 static foo() { |
| 16 () {} (); // Hack to avoid inlining. |
| 17 return 1; |
| 18 } |
| 19 bar() { |
| 20 () {} (); // Hack to avoid inlining. |
| 21 return 1; |
| 22 } |
| 23 } |
| 24 |
| 25 class C1 { |
| 26 static var foo = const {}; |
| 27 var bar = const {}; |
| 28 } |
| 29 |
| 30 class C2 { |
| 31 static var foo = new Map.from({1: 2}); |
| 32 var bar = new Map.from({1: 2}); |
| 33 } |
| 34 |
| 35 class C3 { |
| 36 static final foo = const ConstClass(const ConstClass(1)); |
| 37 final bar = const ConstClass(const ConstClass(1)); |
| 38 } |
| 39 |
| 40 class C4 { |
| 41 static final foo = new Map.from({x: x}); |
| 42 final bar = new Map.from({x: x}); |
| 43 } |
| 44 |
| 45 class C5 { |
| 46 static const foo = const [const {1: 3}]; |
| 47 bar() { |
| 48 () {} (); // Hack to avoid inlining. |
| 49 return 1; |
| 50 } |
| 51 } |
OLD | NEW |