Skip to content

type hole in hs-boot file triggers GHC internal error

Put each line in a separate file, the last one is B.hs-boot

module A where { import {-# SOURCE #-} B }

module B where { }

module B where { data T a ; foo :: T _ }

then

$ ghci A.hs 

GHCi, version 8.6.3: http://www.haskell.org/ghc/  :? for help
[1 of 3] Compiling B[boot]          ( B.hs-boot, interpreted )

B.hs-boot:1:38: error:
    • GHC internal error: ‘_’ is not in scope during type checking, but it passed the renamer
      tcl_env of environment: []
    • In the first argument of ‘T’, namely ‘_’
      In the type signature: foo :: T _
  |
1 | module B where { data T a ; foo :: T _ }
  |                                      ^

I know the program is invalid (the hole has no valid instance) but still it should not produce an internal error?

Trac metadata
Trac field Value
Version 8.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