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

Side by Side Diff: pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart

Issue 2341263002: Handle generic factory constructors in kernel_impact (Closed)
Patch Set: Updated cf. comment. Created 4 years, 3 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
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 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
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
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 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/resolution/type_resolver.dart ('k') | pkg/compiler/lib/src/ssa/kernel_impact.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698