| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2011, 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 // Check that class with const constructor has only final fields. | |
| 5 | |
| 6 | |
| 7 class NixFinal { | |
| 8 const NixFinal(var v): finalField = v; // Expect compile error here. | |
| 9 final finalField; | |
| 10 var nixFinalField; | |
| 11 } | |
| 12 | |
| 13 | |
| 14 class ConstConstructorNegativeTest { | |
| 15 static testMain() { | |
| 16 var o = const NixFinal(5); | |
| 17 Expect.equals(true, false); | |
| 18 } | |
| 19 } | |
| 20 | |
| 21 main() { | |
| 22 ConstConstructorNegativeTest.testMain(); | |
| 23 } | |
| OLD | NEW |