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 that used to crash on this code. |
| 6 |
| 7 class A { |
| 8 operator[]=(index, value) { |
| 9 switch (value) { |
| 10 case 42: break; |
| 11 case 43: break; |
| 12 } |
| 13 } |
| 14 } |
| 15 |
| 16 main() { |
| 17 // Make [a] a phi. |
| 18 var a; |
| 19 if (true) { |
| 20 a = new A(); |
| 21 } else { |
| 22 a = new A(); |
| 23 } |
| 24 // `A[]=` being inlined, the compiler was confused when merging the |
| 25 // phis after the switch. |
| 26 a[0] = 42; |
| 27 |
| 28 // Use [a] to provoke the crash. |
| 29 print(a); |
| 30 } |
OLD | NEW |