Skip to content

GHC 7.10.1 panic due to PartialTypeSignatures, TypeFamilies, and local bindings

{-# LANGUAGE PartialTypeSignatures #-}
{-# LANGUAGE TypeFamilies #-}
module Bad
where

foo f = g
  where g r = x
          where x :: _
                x = r

When compiled, it produces the following output:

[1 of 1] Compiling Bad              ( src/Bad.hs, src/Bad.o )

src/Bad.hs:8:22: Warning:
    Found hole ‘_’ with type: w_1
    Where: ‘w_1’ is a rigid type variable bound by
                 the inferred type of g :: w_1 -> w_1 at src/Bad.hs:7:9
    Relevant bindings include
      r :: w_1 (bound at src/Bad.hs:7:11)
      g :: w_1 -> w_1 (bound at src/Bad.hs:7:9)
      f :: t (bound at src/Bad.hs:6:5)
      foo :: t -> w_ -> w_ (bound at src/Bad.hs:6:1)
    In the type signature for ‘x’: _
    In an equation for ‘g’:
        g r
          = x
          where
              x :: _
              x = r
    In an equation for ‘foo’:
        foo f
          = g
          where
              g r
                = x
                where
                    x :: _
                    x = r
ghc: panic! (the 'impossible' happened)
  (GHC version 7.10.1 for x86_64-unknown-linux):
	StgCmmEnv: variable not found
  x_alC
  local binds for:
  f_sv5
  r_sv6

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
Trac metadata
Trac field Value
Version 7.10.1
Type Bug
TypeOfFailure OtherFailure
Priority high
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