| 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 // SharedOptions=--enable-enum | |
| 6 | |
| 7 // Basic syntax test for enumeration types | 5 // Basic syntax test for enumeration types |
| 8 | 6 |
| 9 import 'package:expect/expect.dart'; | 7 import 'package:expect/expect.dart'; |
| 10 | 8 |
| 11 | 9 |
| 12 enum Color { red, orange, yellow, green } | 10 enum Color { red, orange, yellow, green } |
| 13 | 11 |
| 14 // Additional comma at end of list is ok. | 12 // Additional comma at end of list is ok. |
| 15 enum Veggies { carrot, bean, broccolo, } | 13 enum Veggies { carrot, bean, broccolo, } |
| 16 | 14 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 var x = zzTop.Frank; /// 11: continued | 62 var x = zzTop.Frank; /// 11: continued |
| 65 | 63 |
| 66 var x = new Rainbow(); /// 20: continued | 64 var x = new Rainbow(); /// 20: continued |
| 67 var x = new Rainbow(); /// 21: continued | 65 var x = new Rainbow(); /// 21: continued |
| 68 var x = new Rainbow(); /// 22: continued | 66 var x = new Rainbow(); /// 22: continued |
| 69 | 67 |
| 70 // It is a compile-time error to explicitly instantiate an enum instance. | 68 // It is a compile-time error to explicitly instantiate an enum instance. |
| 71 var x = new Color(); /// 30: compile-time error | 69 var x = new Color(); /// 30: compile-time error |
| 72 } | 70 } |
| 73 | 71 |
| OLD | NEW |