| 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
| 4 | 4 |
| 5 library rasta.kernel; | 5 library rasta.kernel; |
| 6 | 6 |
| 7 import 'dart:async' show | 7 import 'dart:async' show |
| 8 Future; | 8 Future; |
| 9 | 9 |
| 10 import 'dart:collection' show | 10 import 'dart:collection' show |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 ir.Class cls = classToIr(type.element); | 245 ir.Class cls = classToIr(type.element); |
| 246 if (type.typeArguments.isEmpty) { | 246 if (type.typeArguments.isEmpty) { |
| 247 return cls.rawType; | 247 return cls.rawType; |
| 248 } else { | 248 } else { |
| 249 return new ir.InterfaceType(cls, typesToIr(type.typeArguments)); | 249 return new ir.InterfaceType(cls, typesToIr(type.typeArguments)); |
| 250 } | 250 } |
| 251 } | 251 } |
| 252 | 252 |
| 253 // TODO(ahe): Remove this method when dart2js support generic type arguments. | 253 // TODO(ahe): Remove this method when dart2js support generic type arguments. |
| 254 List<ir.TypeParameter> typeParametersNotImplemented() { | 254 List<ir.TypeParameter> typeParametersNotImplemented() { |
| 255 return const <ir.TypeParameter>[]; | 255 return <ir.TypeParameter>[]; |
| 256 } | 256 } |
| 257 | 257 |
| 258 ir.FunctionType functionTypeToIr(FunctionType type) { | 258 ir.FunctionType functionTypeToIr(FunctionType type) { |
| 259 List<ir.TypeParameter> typeParameters = typeParametersNotImplemented(); | 259 List<ir.TypeParameter> typeParameters = typeParametersNotImplemented(); |
| 260 int requiredParameterCount = type.parameterTypes.length; | 260 int requiredParameterCount = type.parameterTypes.length; |
| 261 List<ir.DartType> positionalParameters = | 261 List<ir.DartType> positionalParameters = |
| 262 new List<ir.DartType>.from(typesToIr(type.parameterTypes)) | 262 new List<ir.DartType>.from(typesToIr(type.parameterTypes)) |
| 263 ..addAll(typesToIr(type.optionalParameterTypes)); | 263 ..addAll(typesToIr(type.optionalParameterTypes)); |
| 264 Map<String, ir.DartType> namedParameters = <String, ir.DartType>{}; | 264 Map<String, ir.DartType> namedParameters = <String, ir.DartType>{}; |
| 265 for (int i = 0; i < type.namedParameters.length; i++) { | 265 for (int i = 0; i < type.namedParameters.length; i++) { |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 687 } | 687 } |
| 688 | 688 |
| 689 class ConstructorTarget { | 689 class ConstructorTarget { |
| 690 final ConstructorElement element; | 690 final ConstructorElement element; |
| 691 final DartType type; | 691 final DartType type; |
| 692 | 692 |
| 693 ConstructorTarget(this.element, this.type); | 693 ConstructorTarget(this.element, this.type); |
| 694 | 694 |
| 695 String toString() => "ConstructorTarget($element, $type)"; | 695 String toString() => "ConstructorTarget($element, $type)"; |
| 696 } | 696 } |
| OLD | NEW |