diff options
author | Daniel Rogozin <daniel.rogozin@serokell.io> | 2020-09-24 16:30:59 +0300 |
---|---|---|
committer | Daniel Rogozin <daniel.rogozin@serokell.io> | 2020-10-11 22:20:04 +0300 |
commit | 990ea991a1c35fdb894fcb91f919fb8f8fed33dd (patch) | |
tree | 6a2a2c9719e692927bcfa2cac4f832c4f12c0753 /testsuite/tests/th/T17270.hs | |
parent | 274e21f02fabb4b3761841972b1074d0c0146fae (diff) | |
download | haskell-990ea991a1c35fdb894fcb91f919fb8f8fed33dd.tar.gz |
Fall back to types when looking up data constructors (#18740)wip/ghc-18740-lookup-update
Before this patch, referring to a data constructor in a term-level
context led to a scoping error:
ghci> id Int
<interactive>:1:4: error: Data constructor not in scope: Int
After this patch, the renamer falls back to the type namespace
and successfully finds the Int. It is then rejected in the type
checker with a more useful error message:
<interactive>:1:4: error:
• Illegal term-level use of the type constructor ‘Int’
imported from ‘Prelude’ (and originally defined in ‘GHC.Types’)
• In the first argument of ‘id’, namely ‘Int’
In the expression: id Int
We also do this for type variables.
Diffstat (limited to 'testsuite/tests/th/T17270.hs')
0 files changed, 0 insertions, 0 deletions