GHC 9.8 regression: Fixity declaration for prefix type family in class no longer accepted
GHC 9.8 and HEAD reject the following program (minimized from the singletons-base
test suite), which GHC 9.6 and earlier accept:
{-# LANGUAGE TypeFamilies #-}
module Bug where
class POrd a where
type Geq a b
infixr 6 `Geq`
$ ghc-9.6.2 Bug.hs
[1 of 1] Compiling Bug ( Bug.hs, Bug.o )
$ ghc-9.8.0.20230929 Bug.hs
[1 of 1] Compiling Bug ( Bug.hs, Bug.o )
Bug.hs:6:12: error: [GHC-54721]
‘Geq’ is not a (visible) method of class ‘POrd’
|
6 | infixr 6 `Geq`
| ^^^^^
This is likely related to #23664 (closed), except that that bug can only be triggered if the type family name consists of symbolic characters. This bug, on the other hand, occurs when the name has alphanumeric characters.
Edited by Ryan Scott