Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix forward type family in boot file (9.8.2) #526

Merged
merged 1 commit into from
Jun 28, 2024
Merged

Conversation

alt-romes
Copy link
Collaborator

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.

@alt-romes
Copy link
Collaborator Author

alt-romes commented May 8, 2024

I realise now that these sources may be autogenerated.
Where could I do this change correctly @expipiplus1 ?

@alt-romes alt-romes changed the title Fix forward type family in boot file ( Fix forward type family in boot file (9.8.2) May 8, 2024
@k355l3r-5yndr0m3
Copy link

@alt-romes Reading the code, I think I found the line that need to change.

class PeekChain (xs :: [Type])
class PokeChain (xs :: [Type])
type family Extends (p :: [Type] -> Type) (x :: Type) :: Constraint
type family Extendss (p :: [Type] -> Type) (xs :: [Type]) :: Constraint where
Extendss p '[] = ()
Extendss p (x : xs) = (Extends p x, Extendss p xs)
type family Chain (xs :: [a]) = (r :: a) | r -> xs where
Chain '[] = ()
Chain (x:xs) = (x, Chain xs)

@alt-romes alt-romes force-pushed the wip/romes/fixes-9.8 branch from a1bb104 to 8a99959 Compare June 19, 2024 13:42
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
@alt-romes alt-romes force-pushed the wip/romes/fixes-9.8 branch from 8a99959 to 347cfad Compare June 19, 2024 14:16
@alt-romes
Copy link
Collaborator Author

@dpwiz I've updated this patch to change the bindings generation code. The CI failures look unrelated to this patch.

@dpwiz dpwiz merged commit 2e38033 into main Jun 28, 2024
7 of 19 checks passed
@dpwiz dpwiz deleted the wip/romes/fixes-9.8 branch June 28, 2024 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants