Skip to content

ExistentialQuantification plus DeriveDataTypeable leads to core lint error

The attached program produces an core lint error when compiling with optimization.

$ ghc -O -debug -dcore-lint Main
[1 of 1] Compiling Main             ( Main.hs, Main.o )
*** Core Lint errors : in result of Float out(FOS {Lam = Just 0,
                                                   Consts = True,
                                                   PAPs = True}) ***
<no location info>: Warning:
    In the type ‛cache_s16y’
    @ cache_s16y is out of scope
*** Offending Program ***
Main.focusAst
  :: forall syntax_aB4.
     GHC.Types.Int
     -> Main.BufferImpl syntax_aB4 -> Main.BufferImpl syntax_aB4
[LclIdX,
 Arity=2,
 Str=DmdType <L,U><S(S),1*U(U)>m,
 Unf=Unf{Src=InlineStable, TopLvl=True, Arity=2, Value=True,
         ConLike=True, WorkFree=True, Expandable=True,
         Guidance=ALWAYS_IF(unsat_ok=True,boring_ok=False)
         Tmpl= \ (@ syntax_aMw)
                 (r_aB5 [Occ=Once] :: GHC.Types.Int)
                 (b_aB6 [Occ=Once!] :: Main.BufferImpl syntax_aMw) ->
                 case b_aB6
                 of _ [Occ=Dead, Dmd=<L,A>]
                 { Main.FBufferData ds_dOP [Occ=Once!, Dmd=<S,U>] ->
                 case ds_dOP
                 of _ [Occ=Dead, Dmd=<L,A>]
                 { Main.HLState @ cache_s16y dt_s16z [Dmd=<C(C(S)),U>]
                                cache_s16A [Occ=Once, Dmd=<S,U>] ->
                 case dt_s16z r_aB5 cache_s16A of dt_XBQ { __DEFAULT ->
                 Main.FBufferData
                   @ syntax_aMw
                   (Main.HLState @ syntax_aMw @ cache_s16y dt_s16z dt_XBQ)
                 }
                 }
                 }}]
Main.focusAst =
  \ (@ syntax_aMw)
    (r_aB5 :: GHC.Types.Int)
    (b_aB6 :: Main.BufferImpl syntax_aMw) ->
    case b_aB6
    of _ [Occ=Dead, Dmd=<L,A>] { Main.FBufferData ds_dOP [Dmd=<S,U>] ->
    case ds_dOP
    of _ [Occ=Dead] { Main.HLState @ cache_s220 dt_s221 cache_s222 ->
    case dt_s221 r_aB5 cache_s222 of dt_XBQ { __DEFAULT ->
    Main.FBufferData
      @ syntax_aMw
      (Main.HLState @ syntax_aMw @ cache_s220 dt_s221 dt_XBQ)
    }
    }
    }
<snip>

The full log is attached.

The same error occurs with a GHC HEAD build from 2012/12/12. I will check with a latest HEAD.

Trac metadata
Trac field Value
Version 7.6.3
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information