Skip to content

deriveAutoReg fails on newer GHC version #3100

@rowanG077

Description

@rowanG077

It fails due to the name of GHC.TypeNats.KnownNat being changed to GHC.Internal.TypeNats.KnownNat while it's hardcoded in deriveAutoReg, which gives the error:

Missing instance GHC.Internal.TypeNats.KnownNat (Protocols.MsgDataLen cfg_0)

constraintsWantedFor :: Name -> [Type] -> Q Cxt
constraintsWantedFor clsNm tys
| show clsNm == "GHC.TypeNats.KnownNat" = do
-- KnownNat is special, you can't just lookup instances with reifyInstances.
-- So we just pass KnownNat constraints.
-- This will most likely require UndecidableInstances.
return [conAppsT clsNm tys]

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions