Skip to content
Snippets Groups Projects
Commit 6af8e71e authored by Simon Peyton Jones's avatar Simon Peyton Jones Committed by Marge Bot
Browse files

Improve errors for non-existent labels

This patch fixes #17469, by improving matters when you use
non-existent field names in a record construction:
   data T = MkT { x :: Int }
   f v = MkT { y = 3 }

The check is now made in the renamer, in GHC.Rename.Env.lookupRecFieldOcc.

That in turn led to a spurious error in T9975a, which is fixed by
making GHC.Rename.Names.extendGlobalRdrEnvRn fail fast if it finds
duplicate bindings.  See Note [Fail fast on duplicate definitions]
in that module for more details.

This patch was originated and worked on by Alex D (@nineonine)
parent bf495f72
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment