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 library fasta.kernel_type_variable_builder; | 5 library fasta.kernel_type_variable_builder; |
6 | 6 |
7 import 'package:kernel/ast.dart' show | 7 import 'package:kernel/ast.dart' show |
8 DartType, | 8 DartType, |
9 DynamicType, | 9 DynamicType, |
10 TypeParameter, | 10 TypeParameter, |
11 TypeParameterType; | 11 TypeParameterType; |
12 | 12 |
13 import '../errors.dart' show | 13 import '../errors.dart' show |
14 inputError; | 14 inputError; |
15 | 15 |
16 import 'kernel_builder.dart' show | 16 import 'kernel_builder.dart' show |
17 KernelInterfaceTypeBuilder, | 17 KernelNamedTypeBuilder, |
18 KernelTypeBuilder, | 18 KernelTypeBuilder, |
19 TypeVariableBuilder; | 19 TypeVariableBuilder; |
20 | 20 |
21 class KernelTypeVariableBuilder | 21 class KernelTypeVariableBuilder |
22 extends TypeVariableBuilder<KernelTypeBuilder, DartType> { | 22 extends TypeVariableBuilder<KernelTypeBuilder, DartType> { |
23 final TypeParameter parameter; | 23 final TypeParameter parameter; |
24 | 24 |
25 KernelTypeVariableBuilder(String name, [KernelTypeBuilder bound]) | 25 KernelTypeVariableBuilder(String name, [KernelTypeBuilder bound]) |
26 : parameter = new TypeParameter(name, const DynamicType()), | 26 : parameter = new TypeParameter(name, const DynamicType()), |
27 super(name, bound); | 27 super(name, bound); |
(...skipping 10 matching lines...) Expand all Loading... |
38 DartType buildTypesWithBuiltArguments(List<DartType> arguments) { | 38 DartType buildTypesWithBuiltArguments(List<DartType> arguments) { |
39 if (arguments != null) { | 39 if (arguments != null) { |
40 return inputError(null, null, | 40 return inputError(null, null, |
41 "Can't use type arguments with type parameter $parameter"); | 41 "Can't use type arguments with type parameter $parameter"); |
42 } else { | 42 } else { |
43 return buildType(null); | 43 return buildType(null); |
44 } | 44 } |
45 } | 45 } |
46 | 46 |
47 KernelTypeBuilder asTypeBuilder() { | 47 KernelTypeBuilder asTypeBuilder() { |
48 return new KernelInterfaceTypeBuilder(name, null) | 48 return new KernelNamedTypeBuilder(name, null) |
49 ..builder = this; | 49 ..builder = this; |
50 } | 50 } |
51 } | 51 } |
OLD | NEW |