Skip to content

Static pointers + defer-type-errors Lint error

This program fails Lint with -fdefer-type-errors:

{-# LANGUAGE StaticPointers #-}
module T where

import GHC.StaticPtr

p :: StaticPtr Bool
p = static 'a'
*** Core Lint errors : in result of Desugar (before optimization) ***
<no location info>: warning:
    Non-CoVar has coercion type co_avC :: Char ~# Bool
    Substitution: [TCvSubst
                     In scope: InScope {}
                     Type env: []
                     Co env: []]
*** Offending Program ***
Rec {
co_avC :: Char ~# Bool
[LclId[CoVarId]]
co_avC
  = case typeError ...

If Lint is disabled, it fails with an assertion failure or a panic.

Related: #18467 (closed)

Edited by Krzysztof Gogolewski
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information