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_builder; | 5 library fasta.kernel_builder; |
6 | 6 |
7 export 'kernel_class_builder.dart' show KernelClassBuilder; | 7 export 'kernel_class_builder.dart' show KernelClassBuilder; |
8 | 8 |
9 export 'kernel_enum_builder.dart' show KernelEnumBuilder; | 9 export 'kernel_enum_builder.dart' show KernelEnumBuilder; |
10 | 10 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 DartType, | 51 DartType, |
52 DynamicType, | 52 DynamicType, |
53 Field, | 53 Field, |
54 Library, | 54 Library, |
55 Member, | 55 Member, |
56 Procedure, | 56 Procedure, |
57 TypeParameter; | 57 TypeParameter; |
58 | 58 |
59 import '../errors.dart' show inputError; | 59 import '../errors.dart' show inputError; |
60 | 60 |
61 List<DartType> computeDefaultTypeArguments( | 61 import '../builder/builder.dart' show LibraryBuilder; |
| 62 |
| 63 List<DartType> computeDefaultTypeArguments(LibraryBuilder library, |
62 List<TypeParameter> typeParameters, List<DartType> arguments) { | 64 List<TypeParameter> typeParameters, List<DartType> arguments) { |
| 65 // TODO(ahe): Not sure what to do if `arguments.length != |
| 66 // cls.typeParameters.length`. |
63 if (arguments == null) { | 67 if (arguments == null) { |
64 return new List<DartType>.filled( | 68 return new List<DartType>.filled( |
65 typeParameters.length, const DynamicType()); | 69 typeParameters.length, const DynamicType()); |
66 } | 70 } |
67 if (arguments.length < typeParameters.length) { | 71 if (arguments.length < typeParameters.length) { |
68 arguments = new List<DartType>.from(arguments); | 72 arguments = new List<DartType>.from(arguments); |
69 for (int i = arguments.length; i < typeParameters.length; i++) { | 73 for (int i = arguments.length; i < typeParameters.length; i++) { |
70 arguments.add(const DynamicType()); | 74 arguments.add(const DynamicType()); |
71 } | 75 } |
72 } else if (arguments.length > typeParameters.length) { | 76 } else if (arguments.length > typeParameters.length) { |
(...skipping 22 matching lines...) Expand all Loading... |
95 charOffset ??= -1; | 99 charOffset ??= -1; |
96 if (charOffset == -1) { | 100 if (charOffset == -1) { |
97 charOffset = member.fileOffset ?? -1; | 101 charOffset = member.fileOffset ?? -1; |
98 } | 102 } |
99 if (charOffset == -1) { | 103 if (charOffset == -1) { |
100 charOffset = cls?.fileOffset ?? -1; | 104 charOffset = cls?.fileOffset ?? -1; |
101 } | 105 } |
102 name = (cls == null ? "" : "${cls.name}::") + name; | 106 name = (cls == null ? "" : "${cls.name}::") + name; |
103 return inputError(uri, charOffset, "Error in $name: $error"); | 107 return inputError(uri, charOffset, "Error in $name: $error"); |
104 } | 108 } |
OLD | NEW |