Commit 6a7dae4b authored by Krzysztof Gogolewski's avatar Krzysztof Gogolewski Committed by Marge Bot
Browse files

Fix typed holes causing linearity errors (#18491)

parent 04bc50b3
......@@ -198,6 +198,8 @@ tcExpr e@(HsUnboundVar _ occ) res_ty
; name <- newSysName occ
; let ev = mkLocalId name Many ty
; emitNewExprHole occ ev ty
; tcEmitBindingUsage bottomUE -- Holes fit any usage environment
-- (#18491)
; tcWrapResultO (UnboundOccurrenceOf occ) e
(HsUnboundVar ev occ) ty res_ty }
......
{-# LANGUAGE LinearTypes #-}
{-# OPTIONS_GHC -fdefer-typed-holes -Wno-typed-holes #-}
module LinearHole where -- #18491
f :: Int #-> Bool #-> Char
f x y = _1
......@@ -35,3 +35,4 @@ test('MultConstructor', expect_broken(broken_multiplicity_syntax), compile, ['']
test('LinearLetRec', expect_broken(405), compile, ['-O -dlinear-core-lint'])
test('LinearTH1', normal, compile, [''])
test('LinearTH2', expect_broken(broken_multiplicity_syntax), compile, [''])
test('LinearHole', normal, compile, [''])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment