Skip to content

GHCi panics due to linkSomeBCOs: no break array with 9.0.1

Summary

ghci-9.0.1 panics with linkSomeBCOs: no break array when defining an instance for the following type class in the REPL:

module Foo (Foo(..)) where

class Foo a where
  bar :: a -> ()
  bar _ = ()

I came across this issue in https://github.com/maoe/influxdb-haskell/pull/85 and the snippet above is the result of code minimization.

Steps to reproduce

  • Save the snippet in the summary as Foo.hs
  • Load it in GHCi and define the following instance in the REPL:
% ghci-9.0.1 Foo.hs
GHCi, version 9.0.1: https://www.haskell.org/ghc/  :? for help
[1 of 1] Compiling Foo              ( Foo.hs, interpreted )
Ok, one module loaded.
ghci> data T = T
ghci> instance Foo T
ghc: panic! (the 'impossible' happened)
  (GHC version 9.0.1:
	linkSomeBCOs: no break array

Please report this as a GHC bug:  https://www.haskell.org/ghc/reportabug

If I delete the default implementation of the method bar, the issue disappears.

Expected behavior

It should just work like 8.10.4:

% ghci-8.10.4 Foo.hs
GHCi, version 8.10.4: https://www.haskell.org/ghc/  :? for help
[1 of 1] Compiling Foo              ( Foo.hs, interpreted )
Ok, one module loaded.
*Foo> data T = T
*Foo> instance Foo T
*Foo>

Environment

  • GHC version used: 9.0.1 installed with ghcup
  • Operating System: macOS 11.2.1 (Big Sur)
  • System Architecture: Intel
Edited by Mitsutoshi Aoe
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information