OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 library type_representation_test; | 5 library type_representation_test; |
6 | 6 |
7 import 'package:expect/expect.dart'; | 7 import 'package:expect/expect.dart'; |
8 import "package:async_helper/async_helper.dart"; | 8 import "package:async_helper/async_helper.dart"; |
9 import 'type_test_helper.dart'; | 9 import 'type_test_helper.dart'; |
10 import 'package:compiler/src/elements/resolution_types.dart'; | 10 import 'package:compiler/src/elements/resolution_types.dart'; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 m7(int a, String b, [List<int> c, d]) {} | 42 m7(int a, String b, [List<int> c, d]) {} |
43 m8(int a, {String b}) {} | 43 m8(int a, {String b}) {} |
44 m9(int a, String b, {List<int> c, d}) {} | 44 m9(int a, String b, {List<int> c, d}) {} |
45 m10(void f(int a, [b])) {} | 45 m10(void f(int a, [b])) {} |
46 """).then((env) { | 46 """).then((env) { |
47 var closedWorldRefiner = env.compiler.closeResolution(); | 47 var closedWorldRefiner = env.compiler.closeResolution(); |
48 var closedWorld = closedWorldRefiner.closedWorld; | 48 var closedWorld = closedWorldRefiner.closedWorld; |
49 env.compiler.enqueuer.createCodegenEnqueuer(closedWorld); | 49 env.compiler.enqueuer.createCodegenEnqueuer(closedWorld); |
50 env.compiler.backend.onCodegenStart( | 50 env.compiler.backend.onCodegenStart( |
51 closedWorld, | 51 closedWorld, |
52 new CodegenWorldBuilderImpl( | 52 new ElementCodegenWorldBuilderImpl( |
| 53 env.compiler.elementEnvironment, |
53 env.compiler.backend.nativeBasicData, | 54 env.compiler.backend.nativeBasicData, |
54 closedWorld, | 55 closedWorld, |
55 env.compiler.backend.constants, | 56 env.compiler.backend.constants, |
56 const TypeMaskStrategy())); | 57 const TypeMaskStrategy())); |
57 TypeRepresentationGenerator typeRepresentation = | 58 TypeRepresentationGenerator typeRepresentation = |
58 new TypeRepresentationGenerator(env.compiler.backend.namer); | 59 new TypeRepresentationGenerator(env.compiler.backend.namer); |
59 | 60 |
60 Expression onVariable(ResolutionTypeVariableType variable) { | 61 Expression onVariable(ResolutionTypeVariableType variable) { |
61 return new VariableUse(variable.name); | 62 return new VariableUse(variable.name); |
62 } | 63 } |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 ' $named: {c: [$List_rep, $int_rep], d: null}}'); | 278 ' $named: {c: [$List_rep, $int_rep], d: null}}'); |
278 | 279 |
279 // m10(void f(int a, [b])) {} | 280 // m10(void f(int a, [b])) {} |
280 expect( | 281 expect( |
281 env.getElement('m10').computeType(env.compiler.resolution), | 282 env.getElement('m10').computeType(env.compiler.resolution), |
282 '{$func: 1, $args:' | 283 '{$func: 1, $args:' |
283 ' [{$func: 1,' | 284 ' [{$func: 1,' |
284 ' $retvoid: true, $args: [$int_rep], $opt: [,]}]}'); | 285 ' $retvoid: true, $args: [$int_rep], $opt: [,]}]}'); |
285 })); | 286 })); |
286 } | 287 } |
OLD | NEW |