OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2015, 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 // Verify that an attempt to assign to a class, enum, typedef, or type |
| 6 // parameter produces a compile error. |
| 7 |
| 8 class C<T> { |
| 9 f() { |
| 10 T = null; //# 01: compile-time error |
| 11 } |
| 12 } |
| 13 |
| 14 class D {} |
| 15 |
| 16 enum E { e0 } |
| 17 |
| 18 typedef void F(); |
| 19 |
| 20 main() { |
| 21 new C<D>().f(); |
| 22 D = null; //# 02: compile-time error |
| 23 E = null; //# 03: compile-time error |
| 24 F = null; //# 04: compile-time error |
| 25 } |
OLD | NEW |