Error message prints the same text for different types
Summary
With -fno-print-explicit-runtime-reps
GHC in error messages prints *
even if difference in runtime rep matters to understand why types are different.
Steps to reproduce
module T where
import GHC.Types
type F :: forall r. Type -> TYPE r -> Type
data F a b
type B :: (forall r. TYPE r -> Type) -> Type
data B a = MkB
deriving Show
b :: B (F Int)
b = MkB
On this code GHC will output
• Expected kind ‘* -> *’, but ‘F Int’ has kind ‘* -> *’
• In the first argument of ‘B’, namely ‘(F Int)’
In the type signature: b :: B (F Int)
|
13 | b :: B (F Int)
| ^^^^^
Expected * -> *
, actual - * -> *
, thank you, GHC!
Expected behavior
With -fprint-explicit-runtime-reps
error message becomes informative:
• Expected kind ‘forall (r :: RuntimeRep). TYPE r -> *’,
but ‘F Int’ has kind ‘TYPE r0 -> *’
...
Environment
- GHC version used: All versions from 9.2 to HEAD show the same behavior, I did not test it on earlier ones.