Commit 8f20844d authored by Alan Zimmerman's avatar Alan Zimmerman

Correctly pretty print a wild card in infix position

parent 8f15ab98
......@@ -852,6 +852,7 @@ ppr_expr (OpApp e1 op _ e2)
should_print_infix (HsRecFld f) = Just (pprInfixOcc f)
should_print_infix (HsUnboundVar h@TrueExprHole{})
= Just (pprInfixOcc (unboundVarOcc h))
should_print_infix EWildPat = Just (text "`_`")
should_print_infix (HsWrap _ e) = should_print_infix e
should_print_infix _ = Nothing
......@@ -201,3 +201,7 @@ ppr048:
.PHONY: T13199
$(CHECK_PPR) "`'$(TEST_HC)' $(TEST_HC_OPTS) --print-libdir | tr -d '\r'`" T13199.hs
.PHONY: T13050p
$(CHECK_PPR) "`'$(TEST_HC)' $(TEST_HC_OPTS) --print-libdir | tr -d '\r'`" T13050p.hs
module HolesInfix where
f, g, q :: Int -> Int -> Int
f x y = _ x y
g x y = x `_` y
q x y = x `_a` y
......@@ -47,3 +47,4 @@ test('Ppr046', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr04
test('Ppr047', expect_fail, run_command, ['$MAKE -s --no-print-directory ppr047'])
test('Ppr048', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr048'])
test('T13199', ignore_stderr, run_command, ['$MAKE -s --no-print-directory T13199'])
test('T13050p', ignore_stderr, run_command, ['$MAKE -s --no-print-directory T13050p'])
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment