Skip to content

Distinguish CoVarHoles via IdDetails

Ben Gamari requested to merge wip/covar-holes into master

This adds a new variety of IdDetails, CoercionHoleId. This allows us to distinguish coercion holes from "normal" coercion variables which will be useful when implementing coercion zapping (#8095).

I have broken this out into a separate merge request since I suspect it actually reveals a pre-existing bug: Core Lint is catching some coercion holes that leaked out from typechecking in !611 (closed). Specifically I'm seeing things of the form:

*** Core Lint errors : in result of Desugar (before optimization) ***
T11230.hs:19:1: warning:
    [RHS of testPhantom :: Phantom Char -> Phantom Bool]
    Non-CoVar has coercion type co_a2AG :: Char ~# Bool
*** Offending Program ***

where co_a2AG is a variable introduced via a coercion hole.

Edited by Ben Gamari

Merge request reports