summaryrefslogtreecommitdiff
path: root/compiler/rename
diff options
context:
space:
mode:
authorRichard Eisenberg <rae@richarde.dev>2019-09-25 12:28:40 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-10-03 12:17:30 -0400
commit6655ec734a51eda91273585d8d8e3d5d308a6628 (patch)
tree1f23c2d5e338b214add96b32899f303a7fcf3fc7 /compiler/rename
parent67bf734c6c118aa7caa06875f253defe8b7dd271 (diff)
downloadhaskell-6655ec734a51eda91273585d8d8e3d5d308a6628.tar.gz
Improve documentation around empty tuples/lists
This patch also changes the way we handle empty lists, simplifying them somewhat. See Note [Empty lists]. Previously, we had to special-case empty lists in the type-checker. Now no more! Finally, this patch improves some documentation around the ir_inst field used in the type-checker. This breaks a test case, but I really think the problem is #17251, not really related to this patch. Test case: typecheck/should_compile/T13680
Diffstat (limited to 'compiler/rename')
-rw-r--r--compiler/rename/RnExpr.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rename/RnExpr.hs b/compiler/rename/RnExpr.hs
index 6485c004a6..f2f0685159 100644
--- a/compiler/rename/RnExpr.hs
+++ b/compiler/rename/RnExpr.hs
@@ -121,11 +121,14 @@ rnUnboundVar v
rnExpr (HsVar _ (L l v))
= do { opt_DuplicateRecordFields <- xoptM LangExt.DuplicateRecordFields
; mb_name <- lookupOccRn_overloaded opt_DuplicateRecordFields v
+ ; dflags <- getDynFlags
; case mb_name of {
Nothing -> rnUnboundVar v ;
Just (Left name)
| name == nilDataConName -- Treat [] as an ExplicitList, so that
-- OverloadedLists works correctly
+ -- Note [Empty lists] in GHC.Hs.Expr
+ , xopt LangExt.OverloadedLists dflags
-> rnExpr (ExplicitList noExtField Nothing [])
| otherwise