@@ -153,7 +153,8 @@ TypeCheckItem::visit (HIR::TypeAlias &alias)
153
153
TyTy::BaseType *actual_type
154
154
= TypeCheckType::Resolve (alias.get_type_aliased ());
155
155
156
- context->insert_type (alias.get_mappings (), actual_type);
156
+ context->insert_implicit_type (alias.get_mappings ().get_hirid (),
157
+ actual_type);
157
158
158
159
TyTy::RegionConstraints region_constraints;
159
160
for (auto &where_clause_item : alias.get_where_clause ().get_items ())
@@ -189,7 +190,8 @@ TypeCheckItem::visit (HIR::TupleStruct &struct_decl)
189
190
std::to_string (idx), field_type,
190
191
field.get_locus ());
191
192
fields.push_back (ty_field);
192
- context->insert_type (field.get_mappings (), ty_field->get_field_type ());
193
+ context->insert_implicit_type (field.get_mappings ().get_hirid (),
194
+ ty_field->get_field_type ());
193
195
idx++;
194
196
}
195
197
@@ -241,7 +243,9 @@ TypeCheckItem::visit (HIR::TupleStruct &struct_decl)
241
243
context->get_lifetime_resolver ().get_num_bound_regions ()),
242
244
region_constraints);
243
245
244
- context->insert_type (struct_decl.get_mappings (), type);
246
+ context->insert_implicit_type (struct_decl.get_mappings ().get_hirid (),
247
+ type);
248
+
245
249
infered = type;
246
250
247
251
context->get_variance_analysis_ctx ().add_type_constraints (*type);
@@ -272,7 +276,8 @@ TypeCheckItem::visit (HIR::StructStruct &struct_decl)
272
276
field.get_field_name ().as_string (),
273
277
field_type, field.get_locus ());
274
278
fields.push_back (ty_field);
275
- context->insert_type (field.get_mappings (), ty_field->get_field_type ());
279
+ context->insert_implicit_type (field.get_mappings ().get_hirid (),
280
+ ty_field->get_field_type ());
276
281
}
277
282
278
283
auto path = CanonicalPath::create_empty ();
@@ -323,7 +328,8 @@ TypeCheckItem::visit (HIR::StructStruct &struct_decl)
323
328
context->get_lifetime_resolver ().get_num_bound_regions ()),
324
329
region_constraints);
325
330
326
- context->insert_type (struct_decl.get_mappings (), type);
331
+ context->insert_implicit_type (struct_decl.get_mappings ().get_hirid (),
332
+ type);
327
333
infered = type;
328
334
329
335
context->get_variance_analysis_ctx ().add_type_constraints (*type);
@@ -382,7 +388,7 @@ TypeCheckItem::visit (HIR::Enum &enum_decl)
382
388
TyTy::ADTType::ADTKind::ENUM, std::move (variants),
383
389
std::move (substitutions), repr);
384
390
385
- context->insert_type (enum_decl.get_mappings (), type);
391
+ context->insert_implicit_type (enum_decl.get_mappings (). get_hirid (), type);
386
392
infered = type;
387
393
388
394
context->get_variance_analysis_ctx ().add_type_constraints (*type);
@@ -412,8 +418,8 @@ TypeCheckItem::visit (HIR::Union &union_decl)
412
418
variant.get_field_name ().as_string (),
413
419
variant_type, variant.get_locus ());
414
420
fields.push_back (ty_variant);
415
- context->insert_type (variant.get_mappings (),
416
- ty_variant->get_field_type ());
421
+ context->insert_implicit_type (variant.get_mappings (). get_hirid (),
422
+ ty_variant->get_field_type ());
417
423
}
418
424
419
425
// get the path
@@ -453,7 +459,7 @@ TypeCheckItem::visit (HIR::Union &union_decl)
453
459
TyTy::ADTType::ADTKind::UNION, std::move (variants),
454
460
std::move (substitutions));
455
461
456
- context->insert_type (union_decl.get_mappings (), type);
462
+ context->insert_implicit_type (union_decl.get_mappings (). get_hirid (), type);
457
463
infered = type;
458
464
459
465
context->get_variance_analysis_ctx ().add_type_constraints (*type);
@@ -471,7 +477,7 @@ TypeCheckItem::visit (HIR::StaticItem &var)
471
477
TyTy::TyWithLocation (expr_type,
472
478
var.get_expr ().get_locus ()),
473
479
var.get_locus ());
474
- context->insert_type (var.get_mappings (), unified);
480
+ context->insert_implicit_type (var.get_mappings (). get_hirid (), unified);
475
481
infered = unified;
476
482
}
477
483
@@ -486,7 +492,8 @@ TypeCheckItem::visit (HIR::ConstantItem &constant)
486
492
TyTy::TyWithLocation (type, constant.get_type ().get_locus ()),
487
493
TyTy::TyWithLocation (expr_type, constant.get_expr ().get_locus ()),
488
494
constant.get_locus ());
489
- context->insert_type (constant.get_mappings (), unified);
495
+ context->insert_implicit_type (constant.get_mappings ().get_hirid (),
496
+ unified);
490
497
infered = unified;
491
498
}
492
499
@@ -585,7 +592,8 @@ TypeCheckItem::visit (HIR::Function &function)
585
592
{
586
593
// get the name as well required for later on
587
594
auto param_tyty = TypeCheckType::Resolve (param.get_type ());
588
- context->insert_type (param.get_mappings (), param_tyty);
595
+ context->insert_implicit_type (param.get_mappings ().get_hirid (),
596
+ param_tyty);
589
597
TypeCheckPattern::Resolve (param.get_param_name (), param_tyty);
590
598
params.push_back (
591
599
TyTy::FnParam (param.get_param_name ().clone_pattern (), param_tyty));
@@ -622,7 +630,8 @@ TypeCheckItem::visit (HIR::Function &function)
622
630
context->get_lifetime_resolver ().get_num_bound_regions ()),
623
631
region_constraints);
624
632
625
- context->insert_type (function.get_mappings (), fn_type);
633
+ context->insert_implicit_type (function.get_mappings ().get_hirid (),
634
+ fn_type);
626
635
627
636
// need to get the return type from this
628
637
TyTy::FnType *resolved_fn_type = fn_type;
0 commit comments