Commit 4f9d6008 authored by Simon Peyton Jones's avatar Simon Peyton Jones

Fix Trac #10618 (out of scope operator)

Out of scope variables now generate HsUnboundVar,
and the fixity re-jigging wasn't taking this into
account.
parent 85b14a77
......@@ -829,8 +829,11 @@ mkOpAppRn e1 op fix e2 -- Default case, no rearrangment
----------------------------
get_op :: LHsExpr Name -> Name
get_op (L _ (HsVar n)) = n
get_op other = pprPanic "get_op" (ppr other)
-- An unbound name could be either HsVar or HsUnboundVra
-- See RnExpr.rnUnboundVar
get_op (L _ (HsVar n)) = n
get_op (L _ (HsUnboundVar occ)) = mkUnboundName (mkRdrUnqual occ)
get_op other = pprPanic "get_op" (ppr other)
-- Parser left-associates everything, but
-- derived instances may have correctly-associated things to
......
module T10618 where
foo = Just $ Nothing <> Nothing
T10618.hs:3:22: error:
Variable not in scope: (<>) :: Maybe (Maybe a0) -> Maybe a1 -> t
Perhaps you meant one of these:
‘<$>’ (imported from Prelude), ‘*>’ (imported from Prelude),
‘<$’ (imported from Prelude)
......@@ -133,3 +133,4 @@ test('T9032',
normal,
run_command,
['$MAKE -s --no-print-directory T9032'])
test('T10618', normal, compile_fail, [''])
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