Backpack error message prints out data from interface file instead of source file
unit sig where
signature Sig where
data A
instance Show A
unit impl where
module Impl where
type A = Int -> Int
unit main where
dependency sig[Sig=impl:Impl]
module Main where
import Impl
main = print "no"
ghc --backpack Error3.bkp
[1 of 3] Processing sig
[1 of 1] Compiling Sig[sig] ( sig\Sig.hsig, nothing ) [Flags changed]
[2 of 3] Processing impl
Instantiating impl
[1 of 1] Compiling Impl ( impl\Impl.hs, impl\Impl.o ) [Flags changed]
[3 of 3] Processing main
Instantiating main
[1 of 1] Including sig[Sig=impl:Impl]
Instantiating sig[Sig=impl:Impl]
[1 of 1] Compiling Sig[sig] ( sig\Sig.hsig, sig\sig-Absk5cIXTXe6UYhGMYGber\Sig.o )
sig\sig-Absk5cIXTXe6UYhGMYGber\..\Sig.hi:1:1: error:
* No instance for (GHC.Show.Show A)
arising when attempting to show that
instance [safe] GHC.Show.Show A -- Defined at Error3.bkp:4:14
is provided by `impl:Impl'
(maybe you haven't applied a function to enough arguments?)
* while checking that impl:Impl implements signature Sig in sig[Sig=impl:Impl]
|
1 | ☺??d♂90320210928?????☻???☺???☺?☺?☺☺☻☺☺☺☻☺☻??????☺????X?☺?Ã?????☺?????<???????☺???◄►???????????????☺?v????☺????????☺???
?????☺???????B???????☺☻???☻?☻♥?☻♦
| ^
It seems the problem is that we decide to report information contained in the interface file Sig.hi
, which doesn't make any sense.