fix: make IRType.erased a tobject when boxing it (#9431)

This PR changes `IRType.boxed` to map `erased` to `tobject` rather than
`object`, since `erased` has a representation of a boxed scalar 0 when
we are forced to represent it at runtime. This case does not occur at
all in the Lean codebase.
This commit is contained in:
Cameron Zwarich 2025-07-18 13:10:52 -07:00 committed by GitHub
parent 5f4e6a86d5
commit 5cd5885da4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -113,7 +113,7 @@ def isErased : IRType → Bool
| _ => false
def boxed : IRType → IRType
| object | erased | float | float32 => object
| object | float | float32 => object
| tagged | uint8 | uint16 => tagged
| _ => tobject

View file

@ -93,7 +93,7 @@
dec x_5;
dec x_4;
ret x_9
def Exp.casesOn._override._boxed (x_1 : obj) (x_2 : tobj) (x_3 : tobj) (x_4 : tobj) (x_5 : tobj) (x_6 : tobj) (x_7 : tobj) (x_8 : tobj) (x_9 : tobj) : tobj :=
def Exp.casesOn._override._boxed (x_1 : tobj) (x_2 : tobj) (x_3 : tobj) (x_4 : tobj) (x_5 : tobj) (x_6 : tobj) (x_7 : tobj) (x_8 : tobj) (x_9 : tobj) : tobj :=
let x_10 : tobj := Exp.casesOn._override x_1 x_2 x_3 x_4 x_5 x_6 x_7 x_8 x_9;
dec x_9;
dec x_8;