OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 import 'package:kernel/ast.dart' as ir; | 5 import 'package:kernel/ast.dart' as ir; |
6 | 6 |
7 import '../common.dart'; | 7 import '../common.dart'; |
8 import '../common/names.dart'; | 8 import '../common/names.dart'; |
9 import '../compiler.dart'; | 9 import '../compiler.dart'; |
10 import '../constants/values.dart'; | 10 import '../constants/values.dart'; |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 | 166 |
167 ir.Procedure get mapLiteralConstructor => | 167 ir.Procedure get mapLiteralConstructor => |
168 kernel.functions[_backend.helpers.mapLiteralConstructor]; | 168 kernel.functions[_backend.helpers.mapLiteralConstructor]; |
169 | 169 |
170 ir.Procedure get mapLiteralConstructorEmpty => | 170 ir.Procedure get mapLiteralConstructorEmpty => |
171 kernel.functions[_backend.helpers.mapLiteralConstructorEmpty]; | 171 kernel.functions[_backend.helpers.mapLiteralConstructorEmpty]; |
172 | 172 |
173 DartType getDartType(ir.DartType type) { | 173 DartType getDartType(ir.DartType type) { |
174 return type.accept(_typeConverter); | 174 return type.accept(_typeConverter); |
175 } | 175 } |
| 176 |
| 177 List<DartType> getDartTypes(List<ir.DartType> types) { |
| 178 return types.map(getDartType).toList(); |
| 179 } |
176 } | 180 } |
177 | 181 |
178 class DartTypeConverter extends ir.DartTypeVisitor<DartType> { | 182 class DartTypeConverter extends ir.DartTypeVisitor<DartType> { |
179 final KernelAstAdapter astAdapter; | 183 final KernelAstAdapter astAdapter; |
180 | 184 |
181 DartTypeConverter(this.astAdapter); | 185 DartTypeConverter(this.astAdapter); |
182 | 186 |
183 List<DartType> visitTypes(List<ir.DartType> types) { | 187 List<DartType> visitTypes(List<ir.DartType> types) { |
184 return new List.generate( | 188 return new List.generate( |
185 types.length, (int index) => types[index].accept(this)); | 189 types.length, (int index) => types[index].accept(this)); |
(...skipping 23 matching lines...) Expand all Loading... |
209 @override | 213 @override |
210 DartType visitDynamicType(ir.DynamicType node) { | 214 DartType visitDynamicType(ir.DynamicType node) { |
211 return const DynamicType(); | 215 return const DynamicType(); |
212 } | 216 } |
213 | 217 |
214 @override | 218 @override |
215 DartType visitInvalidType(ir.InvalidType node) { | 219 DartType visitInvalidType(ir.InvalidType node) { |
216 throw new UnimplementedError("Invalid types not currently supported"); | 220 throw new UnimplementedError("Invalid types not currently supported"); |
217 } | 221 } |
218 } | 222 } |
OLD | NEW |