jcpetruzza / barbies

BSD 3-Clause "New" or "Revised" License
92 stars 15 forks source link

ghc bug: "Iface type variable out of scope" #45

Closed gelisam closed 1 year ago

gelisam commented 1 year ago

Hi! We encountered a ghc regression in our codebase, and when I minimized the code in order to open a ghc ticket, I was left with a short piece of code which uses the barbies-2.0.4.0 library. I am thus creating this ticket in order to help others who might have encountered this strange error message:

typecheckIface
Declaration for $fConstraintsBTYPETypeB
Class ops for dfun $fConstraintsBTYPETypeB:
  Iface type variable out of scope:  k

<no location info>: error:
    Cannot continue after interface file error

Here is a repo which demonstrate how to trigger the bug: https://github.com/gelisam/ghc-9.4-bug/tree/with-barbies

gelisam commented 1 year ago

I have created a corresponding GHC ticket: https://gitlab.haskell.org/ghc/ghc/-/issues/23329

jcpetruzza commented 1 year ago

Nice find! IIUC, this is an issue only in GHC 9.4 (where the build actually fails), and a proper fix will be included in 9.4.6 and 9.6.2, so we can close this on our end. Thanks for reporting!