diff options
author | Richard Eisenberg <rae@richarde.dev> | 2020-12-24 15:04:06 -0500 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-12-25 03:48:37 -0500 |
commit | 164887da63eaac4e786921a9d3591d4b796ee39e (patch) | |
tree | 1b07e39811e3dd0c587cf5349a0ee06d5d24cbed /compiler/GHC/HsToCore/Coverage.hs | |
parent | adaa6194753f33a705ac57cd8ddb94dc9aff1f54 (diff) | |
download | haskell-164887da63eaac4e786921a9d3591d4b796ee39e.tar.gz |
Use mutable update to defer out-of-scope errors
Previously, we let-bound an identifier to use to carry
the erroring evidence for an out-of-scope variable. But
this failed for levity-polymorphic out-of-scope variables,
leading to a panic (#17812). The new plan is to use
a mutable update to just write the erroring expression directly
where it needs to go.
Close #17812.
Test case: typecheck/should_compile/T17812
Diffstat (limited to 'compiler/GHC/HsToCore/Coverage.hs')
-rw-r--r-- | compiler/GHC/HsToCore/Coverage.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/GHC/HsToCore/Coverage.hs b/compiler/GHC/HsToCore/Coverage.hs index cdc68599ba..db0d72bc9d 100644 --- a/compiler/GHC/HsToCore/Coverage.hs +++ b/compiler/GHC/HsToCore/Coverage.hs @@ -511,7 +511,7 @@ addBinTickLHsExpr boxLabel (L pos e0) addTickHsExpr :: HsExpr GhcTc -> TM (HsExpr GhcTc) addTickHsExpr e@(HsVar _ (L _ id)) = do freeVar id; return e -addTickHsExpr e@(HsUnboundVar id _) = do freeVar id; return e +addTickHsExpr e@(HsUnboundVar {}) = return e addTickHsExpr e@(HsRecFld _ (Ambiguous id _)) = do freeVar id; return e addTickHsExpr e@(HsRecFld _ (Unambiguous id _)) = do freeVar id; return e addTickHsExpr e@(HsConLikeOut _ con) |