Skip to content

Behavior change in ghc 9.4 creates problems with DuplicateFieldNames in code generation #86

@maralorn

Description

@maralorn

I have two queries, which both have a $name parameter.

Since ghc 9.4 this creates an ambiguity in the generated getArgs at "name" .= _name (query :: PullRequestQuery) even though there is a type annotation there, Haskell is not sure which _name accessor to use. I get:

       > lib/NixpkgsBot/GraphQL/API.hs:197:19: error:
       >     Ambiguous occurrence ‘_name’
       >     It could refer to
       >        either the field ‘_name’ of record ‘PullRequestQuery’,
       >               defined at lib/NixpkgsBot/GraphQL/API.hs:136:5
       >            or the field ‘_name’ of record ‘MergingPullRequestQuery’,
       >               defined at lib/NixpkgsBot/GraphQL/API.hs:37:5
       >     |
       > 197 |       , "name" .= _name (query :: PullRequestQuery)
       >     |                   ^^^^^

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions