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

Better errors on duplicate record fields #8994

Closed
cocreature opened this issue Mar 3, 2021 · 0 comments · Fixed by #9010
Closed

Better errors on duplicate record fields #8994

cocreature opened this issue Mar 3, 2021 · 0 comments · Fixed by #9010

Comments

@cocreature
Copy link
Contributor

Currently, duplicate record fields only blow up in the daml-lf typechecker or indirectly when they are used somewhere. We should really produce a better error more directly. Unfortunately, GHC itself accepts the following program:

{-# LANGUAGE DuplicateRecordFields, DisambiguateRecordFields #-}
module Test where

data X = X { a :: Int, a :: Int }

It seems reasonable to add this check to our preprocessor.

@cocreature cocreature added this to the DAML Language Team Backlog milestone Mar 3, 2021
cocreature added a commit that referenced this issue Mar 3, 2021
fixes #8994

changelog_begin
changelog_end
cocreature added a commit that referenced this issue Mar 4, 2021
* Improve errors on duplicate record field names

fixes #8994

changelog_begin
changelog_end

* Apparently I was wrong about names

changelog_begin
changelog_end

* hlint

changelog_begin
changelog_end

* newlines don’t render well in daml build

changelog_begin
changelog_end

* maybe I should test if my code compiles before pushing

changelog_begin
changelog_end
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 a pull request may close this issue.

1 participant