OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 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 | 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 // Test that we detect that a function literal is not | 4 // Test that we detect that a function literal is not |
5 // a compile time constant. | 5 // a compile time constant. |
6 | 6 |
7 class FunctionTypeParameterNegativeTest { | 7 class FunctionTypeParameterNegativeTest { |
8 | |
9 static var formatter; | 8 static var formatter; |
10 | 9 |
11 static SetFormatter([String fmt(int i) = (i) => "$i"]) { | 10 static SetFormatter([String fmt(int i) = (i) => "$i"]) { |
12 formatter = fmt; | 11 formatter = fmt; |
13 } | 12 } |
14 | 13 |
15 static void testMain() { | 14 static void testMain() { |
16 SetFormatter(); | 15 SetFormatter(); |
17 } | 16 } |
18 } | 17 } |
19 | 18 |
20 main() { | 19 main() { |
21 FunctionTypeParameterNegativeTest.testMain(); | 20 FunctionTypeParameterNegativeTest.testMain(); |
22 } | 21 } |
OLD | NEW |