Skip to content

Transfer DFunId-ness onto specialised bindings

Matthew Pickering requested to merge wip/t22549 into master

Whether a binding is a DFunId or not has consequences for the -fdicts-strict flag, essentially if we are doing demand analysis for a DFunId then -fdicts-strict does not apply because the constraint solver can create recursive groups of dictionaries.

In #22549 (closed) this was fixed for the "normal" case, see Note [Do not strictify the argument dictionaries of a dfun]. However the loop still existed if the DFunId was being specialised.

The problem was that the specialiser would specialise a DFunId and turn it into a VanillaId and so the demand analyser didn't know to apply special treatment to the binding anymore and the whole recursive group was optimised to bottom.

The solution is to transfer over the DFunId-ness of the binding in the specialiser so that the demand analysers knows not to apply the -fstrict-dicts

Fixes #22549 (closed)

Merge request reports