You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Aggregate element width mismatch at a call argument reaches codegen (wrong argument type) instead of a Sema error #1368
Sema accepts a fixed-type aggregate whose element representation differs from the expected parameter type, and codegen rejects it. types_compatible recurses into tuple, array and generic-instance elements with the scalar relation, where any int matches any int and int matches float. No conversion reshapes an aggregate value.
Actual: error: wrong argument type actual=struct{i32,i32} expected=struct{i64,i64} fn=main / error: code generation failed.
Expected: a Sema type error at the argument.
The binding sites are fixed in #1354's PR. check_binding_annotation / aggregate_repr_differs (src/SemaCheck.w) reject let t: (i64, i64) = pair() and let (a, b): (i64, i64) = pair(), where they used to fail as invalid MIR. Call arguments, returns and assignments still use the loose relation. The fix is to apply the same element-representation rule at those sites. Constructors lowered against the expected type ((1, x), Some(x)) come back typed as expected and are unaffected.
Activity
Sema: an aggregate whose elements differ in representation is a type …
Sema: an aggregate whose elements differ in representation is a type …
MIR: switch-table values are Vec[i64] at the three sites that still b…
ehartford commentedon Sep 26, 2026
Verified fixed on main 55739d4 (release binary): Sema error at the call: parameter 't' expects (i64, i64).
D125: tuple arms whose element types differ do not join (was invalid …
D114: layouts never convert, literal context has one reader, law 2's …
D114: isize is the target's size width — literal default, len family,…