Skip to content

Improve pretty-printer defaulting logic (#19361)

Krzysztof Gogolewski requested to merge wip/T19361 into master

As described in Note [Defaulting RuntimeRep variables], GHC should perform defaulting in signatures forall (r :: RuntimeRep). ... but not when printing an error message r ~ LiftedRep.

Previously, this distinction was made by remembering whether we are printing a kind. However, this test could not be used with linear types. Unlike RuntimeRep, Multiplicity is used in types rather than kinds. This caused #19361.

Here I am changing the condition: perform defaulting for metavariables but not skolems.

The output in T15883* changes, but I think the defaulting was overeager previously.

Edited by Krzysztof Gogolewski

Merge request reports