[GHC] #16246: GHC HEAD-only Core Lint error with unboxed equality (Non-CoVar has coercion type)

GHC ghc-devs at haskell.org
Sun Jan 27 14:59:38 UTC 2019


#16246: GHC HEAD-only Core Lint error with unboxed equality (Non-CoVar has coercion
type)
-------------------------------------+-------------------------------------
           Reporter:  RyanGlScott    |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:  8.10.1
          Component:  Compiler       |           Version:  8.6.3
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  Compile-time
  Unknown/Multiple                   |  crash or panic
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:  #15648
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 {{{#!hs
 module Foo where

 import Language.Haskell.TH.Lib
 import Language.Haskell.TH.Syntax

 ueqT :: Q Type
 ueqT = conT $ mkNameG_tc "ghc-prim" "GHC.Prim" "~#"
 }}}
 {{{#!hs
 {-# LANGUAGE KindSignatures #-}
 {-# LANGUAGE GADTs #-}
 {-# LANGUAGE TemplateHaskell #-}
 module Bug where

 import Data.Kind
 import Foo (ueqT)

 data JankyEquality :: Type -> Type -> Type where
   Jank :: $ueqT a b -> JankyEquality a b

 unJank :: JankyEquality a b -> $ueqT a b
 unJank (Jank x) = x
 }}}
 {{{
 $ ~/Software/ghc5/inplace/bin/ghc-stage2 --interactive Bug.hs -dcore-lint
 GHCi, version 8.7.20190115: https://www.haskell.org/ghc/  :? for help
 Loaded GHCi configuration from /home/rgscott/.ghci
 [1 of 2] Compiling Foo              ( Foo.hs, interpreted )
 [2 of 2] Compiling Bug              ( Bug.hs, interpreted )
 *** Core Lint errors : in result of Desugar (before optimization) ***
 <no location info>: warning:
     In a case alternative: (Jank x_a4vR :: a_a4wC ~# b_a4wD)
     Non-CoVar has coercion type x_a4vR :: a_a4wC ~# b_a4wD
 *** Offending Program ***

 <elided>

 unJank :: forall a b. JankyEquality a b -> a ~# b
 [LclIdX]
 unJank
   = \ (@ a_a4wC)
       (@ b_a4wD)
       (ds_d4wN :: JankyEquality a_a4wC b_a4wD) ->
       case ds_d4wN of wild_00 { Jank x_a4vR -> break<0>() x_a4vR }
 }}}

 Note that this passes `-dcore-lint` on GHC 8.0.2 through 8.6.3.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/16246>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list