Skip to content

codeGen: Teach unboxed sum rep logic about levity

Ben Gamari requested to merge wip/T19645 into master

Previously Unarise would happily project lifted and unlifted fields to lifted slots. This broke horribly in #19645 (closed), where a ByteArray# was passed in a lifted slot and consequently entered. The simplest way to fix this is what I've done here, distinguishing between lifted and unlifted slots in unarise.

However, one can imagine more clever solutions, where we coerce the binder to the correct levity with respect to the sum's tag. I doubt that this would be worth the effort.

Fixes #19645 (closed).

Merge request reports