| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 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 | 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 library lib1; | 5 library lib1; |
| 6 | 6 |
| 7 class ConstClass { | 7 class ConstClass { |
| 8 final x; | 8 final x; |
| 9 const ConstClass(this.x); | 9 const ConstClass(this.x); |
| 10 } | 10 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 return 1; | 21 return 1; |
| 22 } | 22 } |
| 23 } | 23 } |
| 24 | 24 |
| 25 class C1 { | 25 class C1 { |
| 26 static var foo = const {}; | 26 static var foo = const {}; |
| 27 var bar = const {}; | 27 var bar = const {}; |
| 28 } | 28 } |
| 29 | 29 |
| 30 class C2 { | 30 class C2 { |
| 31 static var foo = new Map.from({1: 2}); | 31 static var foo = new Map<int, int>.from({1: 2}); |
| 32 var bar = new Map.from({1: 2}); | 32 var bar = new Map<int, int>.from({1: 2}); |
| 33 } | 33 } |
| 34 | 34 |
| 35 class C3 { | 35 class C3 { |
| 36 static final foo = const ConstClass(const ConstClass(1)); | 36 static final foo = const ConstClass(const ConstClass(1)); |
| 37 final bar = const ConstClass(const ConstClass(1)); | 37 final bar = const ConstClass(const ConstClass(1)); |
| 38 } | 38 } |
| 39 | 39 |
| 40 class C4 { | 40 class C4 { |
| 41 static final foo = new Map.from({x: x}); | 41 static final foo = new Map<ConstClass, ConstClass>.from({x: x}); |
| 42 final bar = new Map.from({x: x}); | 42 final bar = new Map<ConstClass, ConstClass>.from({x: x}); |
| 43 } | 43 } |
| 44 | 44 |
| 45 class C5 { | 45 class C5 { |
| 46 static const foo = const [const {1: 3}]; | 46 static const foo = const [const {1: 3}]; |
| 47 bar() { | 47 bar() { |
| 48 () {} (); // Hack to avoid inlining. | 48 () {} (); // Hack to avoid inlining. |
| 49 return 1; | 49 return 1; |
| 50 } | 50 } |
| 51 } | 51 } |
| OLD | NEW |