@@ -153,7 +153,7 @@ 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 (), actual_type);
157
157
158
158
TyTy::RegionConstraints region_constraints;
159
159
for (auto &where_clause_item : alias.get_where_clause ().get_items ())
@@ -189,7 +189,7 @@ TypeCheckItem::visit (HIR::TupleStruct &struct_decl)
189
189
std::to_string (idx), field_type,
190
190
field.get_locus ());
191
191
fields.push_back (ty_field);
192
- context->insert_type (field.get_mappings (), ty_field->get_field_type ());
192
+ context->insert_implicit_type (field.get_mappings (). get_hirid (), ty_field->get_field_type ());
193
193
idx++;
194
194
}
195
195
@@ -241,7 +241,8 @@ TypeCheckItem::visit (HIR::TupleStruct &struct_decl)
241
241
context->get_lifetime_resolver ().get_num_bound_regions ()),
242
242
region_constraints);
243
243
244
- context->insert_type (struct_decl.get_mappings (), type);
244
+ context->insert_implicit_type (struct_decl.get_mappings ().get_hirid (), type);
245
+
245
246
infered = type;
246
247
247
248
context->get_variance_analysis_ctx ().add_type_constraints (*type);
@@ -272,7 +273,7 @@ TypeCheckItem::visit (HIR::StructStruct &struct_decl)
272
273
field.get_field_name ().as_string (),
273
274
field_type, field.get_locus ());
274
275
fields.push_back (ty_field);
275
- context->insert_type (field.get_mappings (), ty_field->get_field_type ());
276
+ context->insert_implicit_type (field.get_mappings (). get_hirid (), ty_field->get_field_type ());
276
277
}
277
278
278
279
auto path = CanonicalPath::create_empty ();
@@ -323,7 +324,7 @@ TypeCheckItem::visit (HIR::StructStruct &struct_decl)
323
324
context->get_lifetime_resolver ().get_num_bound_regions ()),
324
325
region_constraints);
325
326
326
- context->insert_type (struct_decl.get_mappings (), type);
327
+ context->insert_implicit_type (struct_decl.get_mappings (). get_hirid (), type);
327
328
infered = type;
328
329
329
330
context->get_variance_analysis_ctx ().add_type_constraints (*type);
@@ -382,7 +383,7 @@ TypeCheckItem::visit (HIR::Enum &enum_decl)
382
383
TyTy::ADTType::ADTKind::ENUM, std::move (variants),
383
384
std::move (substitutions), repr);
384
385
385
- context->insert_type (enum_decl.get_mappings (), type);
386
+ context->insert_implicit_type (enum_decl.get_mappings (). get_hirid (), type);
386
387
infered = type;
387
388
388
389
context->get_variance_analysis_ctx ().add_type_constraints (*type);
@@ -412,7 +413,7 @@ TypeCheckItem::visit (HIR::Union &union_decl)
412
413
variant.get_field_name ().as_string (),
413
414
variant_type, variant.get_locus ());
414
415
fields.push_back (ty_variant);
415
- context->insert_type (variant.get_mappings (),
416
+ context->insert_implicit_type (variant.get_mappings (). get_hirid (),
416
417
ty_variant->get_field_type ());
417
418
}
418
419
@@ -453,7 +454,7 @@ TypeCheckItem::visit (HIR::Union &union_decl)
453
454
TyTy::ADTType::ADTKind::UNION, std::move (variants),
454
455
std::move (substitutions));
455
456
456
- context->insert_type (union_decl.get_mappings (), type);
457
+ context->insert_implicit_type (union_decl.get_mappings (). get_hirid (), type);
457
458
infered = type;
458
459
459
460
context->get_variance_analysis_ctx ().add_type_constraints (*type);
@@ -471,7 +472,7 @@ TypeCheckItem::visit (HIR::StaticItem &var)
471
472
TyTy::TyWithLocation (expr_type,
472
473
var.get_expr ().get_locus ()),
473
474
var.get_locus ());
474
- context->insert_type (var.get_mappings (), unified);
475
+ context->insert_implicit_type (var.get_mappings (). get_hirid (), unified);
475
476
infered = unified;
476
477
}
477
478
@@ -486,7 +487,7 @@ TypeCheckItem::visit (HIR::ConstantItem &constant)
486
487
TyTy::TyWithLocation (type, constant.get_type ().get_locus ()),
487
488
TyTy::TyWithLocation (expr_type, constant.get_expr ().get_locus ()),
488
489
constant.get_locus ());
489
- context->insert_type (constant.get_mappings (), unified);
490
+ context->insert_implicit_type (constant.get_mappings (). get_hirid (), unified);
490
491
infered = unified;
491
492
}
492
493
@@ -585,7 +586,7 @@ TypeCheckItem::visit (HIR::Function &function)
585
586
{
586
587
// get the name as well required for later on
587
588
auto param_tyty = TypeCheckType::Resolve (param.get_type ());
588
- context->insert_type (param.get_mappings (), param_tyty);
589
+ context->insert_implicit_type (param.get_mappings (). get_hirid (), param_tyty);
589
590
TypeCheckPattern::Resolve (param.get_param_name (), param_tyty);
590
591
params.push_back (
591
592
TyTy::FnParam (param.get_param_name ().clone_pattern (), param_tyty));
@@ -622,7 +623,7 @@ TypeCheckItem::visit (HIR::Function &function)
622
623
context->get_lifetime_resolver ().get_num_bound_regions ()),
623
624
region_constraints);
624
625
625
- context->insert_type (function.get_mappings (), fn_type);
626
+ context->insert_implicit_type (function.get_mappings (). get_hirid (), fn_type);
626
627
627
628
// need to get the return type from this
628
629
TyTy::FnType *resolved_fn_type = fn_type;
0 commit comments