Report unsuffixed record literal field with effectful function

This commit is contained in:
Agus Zubiaga 2024-10-22 19:50:32 -03:00
parent ea35094b28
commit 215de707fa
No known key found for this signature in database
7 changed files with 121 additions and 21 deletions

View file

@ -283,6 +283,10 @@ pub fn constrain_expr(
let (field_type, field_con) =
constrain_field(types, constraints, env, field_var, loc_field_expr);
let check_field_con =
constraints.check_record_field_fx(label.suffix(), field_var, field.region);
let field_con = constraints.and_constraint([field_con, check_field_con]);
field_vars.push(field_var);
field_types.insert(label.clone(), RecordField::Required(field_type));