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 // Ensure that the inferrer looks at default values for parameters in | 5 // Ensure that the inferrer looks at default values for parameters in |
6 // synthetic constructors using the correct context. If the constructor call | 6 // synthetic constructors using the correct context. If the constructor call |
7 // to D without optional parameters is inferred using D's context, the default | 7 // to D without optional parameters is inferred using D's context, the default |
8 // value `_SECRET` will not be visible and compilation will fail. | 8 // value `_SECRET` will not be visible and compilation will fail. |
9 | 9 |
10 import 'package:async_helper/async_helper.dart'; | 10 import 'package:expect/expect.dart'; |
| 11 import "package:async_helper/async_helper.dart"; |
11 import 'memory_compiler.dart'; | 12 import 'memory_compiler.dart'; |
12 | 13 |
13 const Map MEMORY_SOURCE_FILES = const { | 14 const Map MEMORY_SOURCE_FILES = const { |
14 "main.dart": r""" | 15 "main.dart": r""" |
15 import "liba.dart"; | 16 import "liba.dart"; |
16 | 17 |
17 class Mixin { | 18 class Mixin { |
18 String get foo => "Mixin:$this"; | 19 String get foo => "Mixin:$this"; |
19 } | 20 } |
20 | 21 |
(...skipping 16 matching lines...) Expand all Loading... |
37 C.b(int x, {var b : const _SECRET()}) : this.x = x, this.y = b; | 38 C.b(int x, {var b : const _SECRET()}) : this.x = x, this.y = b; |
38 String toString() => "C($x,$y)"; | 39 String toString() => "C($x,$y)"; |
39 } | 40 } |
40 """ | 41 """ |
41 }; | 42 }; |
42 | 43 |
43 main() { | 44 main() { |
44 asyncTest(() => runCompiler(memorySourceFiles: MEMORY_SOURCE_FILES)); | 45 asyncTest(() => runCompiler(memorySourceFiles: MEMORY_SOURCE_FILES)); |
45 } | 46 } |
46 | 47 |
OLD | NEW |