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

Example sdl-triangle compiles error in ghc 9.6.3 and success in ghc 8.10.7 #498

Open
ZichaoNickFox opened this issue Dec 10, 2023 · 1 comment

Comments

@ZichaoNickFox
Copy link

Hello. I build a new project, with dependence

extra-deps:
- vulkan-3.26.1@sha256:74209384b562b5b1483b25243e82999f9d55de23b0c574df08495768c3a7ea12,33611
- vulkan-utils-0.5.10.6@sha256:8ee8450d48f7ed4ba6baed20d33f28daae1a14a4f77e610f9dd4875a6b290576,3968

and same language extensions as example/sdl-triangle

- DataKinds
- DefaultSignatures
- DeriveFoldable
- DeriveFunctor
- DeriveTraversable
- DerivingStrategies
- DuplicateRecordFields
- FlexibleContexts
- FlexibleInstances
- GADTs
- GeneralizedNewtypeDeriving
- InstanceSigs
- LambdaCase
- MagicHash
- NamedFieldPuns
- NoMonomorphismRestriction
- NumDecimals
- OverloadedStrings
- PatternSynonyms
- PolyKinds
- QuantifiedConstraints
- RankNTypes
- RecordWildCards
- RoleAnnotations
- ScopedTypeVariables
- StandaloneDeriving
- Strict
- TupleSections
- TypeApplications
- TypeFamilyDependencies
- TypeOperators
- TypeSynonymInstances
- ViewPatterns

When compile with ghc 9.6.3, an compile error occurred. Message is

/Users/liuzichao/Hulkan/test/Main.hs:283:40: error:
    Ambiguous occurrence ‘width’
    It could refer to
       either the field ‘width’ of record ‘Viewport’,
              imported from ‘Vulkan.Core10’ at test/Main.hs:36:1-30
              (and originally defined in ‘Vulkan.Core10.Pipeline’)
           or the field ‘width’ of record ‘FramebufferCreateInfo’,
              imported from ‘Vulkan.Core10’ at test/Main.hs:36:1-30
              (and originally defined in ‘Vulkan.Core10.Pass’)
           or the field ‘width’ of record ‘Extent3D’,
              imported from ‘Vulkan.Core10’ at test/Main.hs:36:1-30
              (and originally defined in ‘Vulkan.Core10.FundamentalTypes’)
           or the field ‘width’ of record ‘Extent2D’,
              imported from ‘Vulkan.Core10’ at test/Main.hs:36:1-30
              (and originally defined in ‘Vulkan.Core10.FundamentalTypes’)
    |       
283 |               , width    = realToFrac (width (swapchainExtent :: Extent2D))
    |    

Position: https://github.com/expipiplus1/vulkan/blob/2007a6ebca9a585028163a850bcedef856fc1e94/examples/sdl-triangle/Main.hs#L283C66-L283C74

Everything is OK in ghc 8.10.7. I think this is not an issue of vulkan project. I just want to get a help why this happend? If ghc 9.6.3 has something different with ghc 8.10.7?

@dpwiz
Copy link
Collaborator

dpwiz commented Nov 21, 2024

Should be fixed by #564

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

No branches or pull requests

2 participants