Skip to content

Precomputed static closures for datacons with zero-width args and nullary con wrappers

Rodrigo Mesquita requested to merge wip/romes/isNullaryRepDataCon into master

Precompute static closures for DataCons with zero-width args

Relax the predicate over nullary datacons that determines whether we can return a precomputed static closure for them, such that we give precomputed static closures to both datacon workers and wrappers as long as they only take zero-width arguments (and hence their closure is comprised of just the constructor info).

Previously, we would only allow datacons that were nullary with regard to their Core representation, which prevented datacons workers with only zero-width arguments and wrappers with none from using a precomputed static closure.

See Note [Precomputed static closures of nullary constructors]

Closes #23158

Edited by Rodrigo Mesquita

Merge request reports