diff options
author | Richard Eisenberg <rae@richarde.dev> | 2019-09-25 12:28:40 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-10-03 12:17:30 -0400 |
commit | 6655ec734a51eda91273585d8d8e3d5d308a6628 (patch) | |
tree | 1f23c2d5e338b214add96b32899f303a7fcf3fc7 /compiler/rename | |
parent | 67bf734c6c118aa7caa06875f253defe8b7dd271 (diff) | |
download | haskell-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.hs | 3 |
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 |