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_test_helper; | 5 library type_test_helper; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'package:expect/expect.dart'; | 8 import 'package:expect/expect.dart'; |
9 import 'compiler_helper.dart' as mock; | 9 import 'compiler_helper.dart' as mock; |
10 import 'memory_compiler.dart' as memory; | 10 import 'memory_compiler.dart' as memory; |
11 import 'package:compiler/src/dart_types.dart'; | 11 import 'package:compiler/implementation/dart_types.dart'; |
12 import 'package:compiler/src/dart2jslib.dart' | 12 import 'package:compiler/implementation/dart2jslib.dart' |
13 show Compiler; | 13 show Compiler; |
14 import 'package:compiler/src/elements/elements.dart' | 14 import 'package:compiler/implementation/elements/elements.dart' |
15 show Element, | 15 show Element, |
16 TypeDeclarationElement, | 16 TypeDeclarationElement, |
17 ClassElement; | 17 ClassElement; |
18 | 18 |
19 GenericType instantiate(TypeDeclarationElement element, | 19 GenericType instantiate(TypeDeclarationElement element, |
20 List<DartType> arguments) { | 20 List<DartType> arguments) { |
21 if (element.isClass) { | 21 if (element.isClass) { |
22 return new InterfaceType(element, arguments); | 22 return new InterfaceType(element, arguments); |
23 } else { | 23 } else { |
24 assert(element.isTypedef); | 24 assert(element.isTypedef); |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 namedParameters.forEach((String name, DartType type) { | 134 namedParameters.forEach((String name, DartType type) { |
135 namedParameterNames.add(name); | 135 namedParameterNames.add(name); |
136 namedParameterTypes.add(type); | 136 namedParameterTypes.add(type); |
137 }); | 137 }); |
138 } | 138 } |
139 return new FunctionType.synthesized( | 139 return new FunctionType.synthesized( |
140 returnType, parameters, optionalParameters, | 140 returnType, parameters, optionalParameters, |
141 namedParameterNames, namedParameterTypes); | 141 namedParameterNames, namedParameterTypes); |
142 } | 142 } |
143 } | 143 } |
OLD | NEW |