Skip to content

Commit

Permalink
Fix forward type family in boot file (9.8.2) (#526)
Browse files Browse the repository at this point in the history
Fixes an hs-boot file which had an incorrect forward declaration of a
closed type family. vulkan would successfully compile despite the
hs-boot error with 9.8.1, but not with 9.8.2 because of bug fixes which
makes the compiler now reject this invalid program.

We need to use the weird `type family A x where ..` (with two literal
dots after `where`) to declare the type family in the boot file.

Fixes compilation with 9.8.2
  • Loading branch information
alt-romes authored Jun 28, 2024
1 parent 3639f9e commit 2e38033
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion generate-new/src/Render/Spec/Extends.hs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ classes Spec {..} = do
tellDoc [qqi|
class PeekChain (xs :: [Type])
class PokeChain (xs :: [Type])
type family Extends (p :: [Type] -> Type) (x :: Type) :: Constraint
type family Extends (p :: [Type] -> Type) (x :: Type) :: Constraint where ..
type family Extendss (p :: [Type] -> Type) (xs :: [Type]) :: Constraint where
Extendss p '[] = ()
Extendss p (x : xs) = (Extends p x, Extendss p xs)
Expand Down
2 changes: 1 addition & 1 deletion src/Vulkan/CStruct/Extends.hs-boot
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ instance FromCStruct BaseOutStructure

class PeekChain (xs :: [Type])
class PokeChain (xs :: [Type])
type family Extends (p :: [Type] -> Type) (x :: Type) :: Constraint
type family Extends (p :: [Type] -> Type) (x :: Type) :: Constraint where ..
type family Extendss (p :: [Type] -> Type) (xs :: [Type]) :: Constraint where
Extendss p '[] = ()
Extendss p (x : xs) = (Extends p x, Extendss p xs)
Expand Down

0 comments on commit 2e38033

Please sign in to comment.