Able to add bogus HasCallStack constraint to instance methods with InstanceSigs
Summary
You can use incorrectly add HasCallStack constraints to signatures in instances.
Thanks to MangoIV for finding this issue.
Steps to reproduce
import Data.Kind (Type)
import GHC.Stack (HasCallStack, prettyCallStack, callStack)
class C (a :: Type) where
cj :: a -> String
instance C () where
cj :: HasCallStack => () -> String
cj _ = prettyCallStack callStack
f :: String
f = cj () -- equal to ""
Expected behavior
This should err.
Environment
- GHC version used: 9.2.4