Commit 96c22d9e authored by cactus's avatar cactus

Tweak the error message for pattern synonym methods,

since they are disallowed both in class and instance declarations
parent 18a4a5da
......@@ -1068,7 +1068,7 @@ methodBindErr mbind
methodPatSynErr :: HsBindLR RdrName RdrName -> SDoc
methodPatSynErr mbind
= hang (ptext (sLit "Pattern synonyms not allowed in instance declarations"))
= hang (ptext (sLit "Pattern synonyms not allowed in class/instance declarations"))
2 (ppr mbind)
bindsInHsBootFile :: LHsBindsLR Name RdrName -> SDoc
......
T9705-1.hs:3:5:
Pattern synonyms not allowed in class/instance declarations
pattern P = ()
{-# LANGUAGE PatternSynonyms #-}
class C a where
method :: a
instance C Int where
pattern P = ()
T9705-2.hs:6:5:
Pattern synonyms not allowed in class/instance declarations
pattern P = ()
T9705.hs:3:5:
Pattern synonyms not allowed in instance declarations
pattern P = ()
......@@ -6,4 +6,5 @@ test('T8961', normal, multimod_compile_fail, ['T8961',''])
test('as-pattern', normal, compile_fail, [''])
test('T9161-1', normal, compile_fail, [''])
test('T9161-2', normal, compile_fail, [''])
test('T9705', normal, compile_fail, [''])
test('T9705-1', normal, compile_fail, [''])
test('T9705-2', normal, compile_fail, [''])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment