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
Codegen fails for struct fields typed as usize/isize #3
usize and isize work in with check, but using them as struct field types fails during codegen/build.
Reproduction
Compiler version:
with version
# with 0.0.1
Minimal repro:
type Shape = {
d0: usize,
s0: isize,
}
fn main:
let x = Shape { d0: 1, s0: 2 }
assert(x.d0 == 1)
Commands:
with check repro.w
# ok
with test repro.w
# error: unresolved type for field 'd0' in struct 'Shape'# error: unresolved type for field 's0' in struct 'Shape'# error: code generation failed# error: test build failed
Expected
If usize / isize are accepted by the type checker, codegen should also support them as struct field types.
Actual
Codegen rejects those fields as unresolved.
Notes
This came up while bootstrapping a With library that follows the current docs and implementation notes, which use usize / isize heavily for shape/stride metadata.
Fixed on main in d8bb583. This was the same codegen primitive-resolution bug as #7: usize/isize struct fields now lower correctly, with regression coverage in test/cases/behav_struct_usize_fields.w.
Activity
Support usize/isize struct fields\n\nFixes #7\nFixes #3
ehartford commentedon Mar 21, 2026
Fixed on main in d8bb583. This was the same codegen primitive-resolution bug as #7:
usize/isizestruct fields now lower correctly, with regression coverage in test/cases/behav_struct_usize_fields.w.Support usize/isize struct fields\n\nFixes #7\nFixes #3
MirLower: a call through a let-alias of a non-Copy fn field calls the…
MirLower: a call through a let-alias of a non-Copy fn field calls the…