Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: pkg/front_end/lib/src/fasta/kernel/kernel_builder.dart

Issue 2746763003: Add default type arguments on Supertype as well. (Closed)
Patch Set: Rebased on 1cb1b70d5daf9ec7f24a98be9d2fdac919ae0c24. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/kernel/kernel_class_builder.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/kernel/kernel_class_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698