Commit 5cb236dd authored by rodlogic's avatar rodlogic Committed by Ben Gamari

fix -ddump-splices to parenthesize ((\x -> x) a) correctly

Test Plan: ./validate

Reviewers: goldfire, austin, bgamari

Subscribers: goldfire, osa1, thomie

Differential Revision: https://phabricator.haskell.org/D1114

GHC Trac Issues: #10603
parent 4405f9de
......@@ -712,8 +712,10 @@ cvtl e = wrapL (cvt e)
cvt (LitE l)
| overloadedLit l = do { l' <- cvtOverLit l; return $ HsOverLit l' }
| otherwise = do { l' <- cvtLit l; return $ HsLit l' }
cvt (AppE x y) = do { x' <- cvtl x; y' <- cvtl y; return $ HsApp x' y' }
cvt (AppE x@(LamE _ _) y) = do { x' <- cvtl x; y' <- cvtl y
; return $ HsApp (mkLHsPar x') y' }
cvt (AppE x y) = do { x' <- cvtl x; y' <- cvtl y
; return $ HsApp x' y' }
cvt (LamE ps e) = do { ps' <- cvtPats ps; e' <- cvtl e
; return $ HsLam (mkMatchGroup FromSource [mkSimpleMatch ps' e']) }
cvt (LamCaseE ms) = do { ms' <- mapM cvtMatch ms
......
T10603.hs:5:18-68: Splicing expression
[| case Just 'a' of {
Just a_atn -> Just ((\ x_ato -> x_ato) a_atn) } |]
[| case Just 'a' of { Just a -> Just ((\ x -> x) a) } |]
======>
case Just 'a' of {
Just a_a4uM -> Just ((\ x_a4uN -> x_a4uN) a_a4uM) }
case Just 'a' of { Just a -> Just ((\ x -> x) a) }
......@@ -397,4 +397,4 @@ test('T11341', normal, compile, ['-v0 -dsuppress-uniques'])
test('T11345', normal, compile_and_run, ['-v0 -dsuppress-uniques'])
test('TH_finalizer', normal, compile, ['-v0'])
test('T10603', expect_broken(10603), compile, ['-ddump-splices'])
\ No newline at end of file
test('T10603', normal, compile, ['-ddump-splices -dsuppress-uniques'])
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