diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2021-07-27 18:07:11 +0100 |
---|---|---|
committer | Alex D <mail4chemik@gmail.com> | 2022-02-04 06:27:34 +0000 |
commit | 32cfc4be9166a795bdb167a7c62ba92eb1ab5767 (patch) | |
tree | 7d63448f6ae4671c86b29e3465045c5568c3edf9 /compiler/GHC/Tc/Utils/Monad.hs | |
parent | 76dd6693dc35ab9aafdef749057009f9a1608e65 (diff) | |
download | haskell-wip/T17469-alex.tar.gz |
Improve errors for non-existent labelswip/T17469-alex
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)
Diffstat (limited to 'compiler/GHC/Tc/Utils/Monad.hs')
-rw-r--r-- | compiler/GHC/Tc/Utils/Monad.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/GHC/Tc/Utils/Monad.hs b/compiler/GHC/Tc/Utils/Monad.hs index ea3b50fa3c..ca2915e8fa 100644 --- a/compiler/GHC/Tc/Utils/Monad.hs +++ b/compiler/GHC/Tc/Utils/Monad.hs @@ -1142,7 +1142,7 @@ reportDiagnostic msg ----------------------- checkNoErrs :: TcM r -> TcM r -- (checkNoErrs m) succeeds iff m succeeds and generates no errors --- If m fails then (checkNoErrsTc m) fails. +-- If m fails then (checkNoErrs m) fails. -- If m succeeds, it checks whether m generated any errors messages -- (it might have recovered internally) -- If so, it fails too. |