[GHC] #9581: Parse error in multiline case expression inside let inside do block
GHC
ghc-devs at haskell.org
Thu Sep 11 22:03:26 UTC 2014
#9581: Parse error in multiline case expression inside let inside do block
-------------------------------------+-------------------------------------
Reporter: mpopov | Owner:
Type: bug | Status: closed
Priority: normal | Milestone:
Component: Compiler | Version: 7.8.3
Resolution: invalid | Keywords:
Operating System: Linux | Architecture: Unknown/Multiple
Type of failure: GHC | Difficulty: Unknown
rejects valid program | Blocked By:
Test Case: | Related Tickets:
Blocking: |
Differential Revisions: |
-------------------------------------+-------------------------------------
Changes (by rwbarton):
* status: new => closed
* resolution: => invalid
Comment:
This program isn't valid. `let` introduces layout, so because line 3's
first non-whitespace character is in the same column as the first non-
whitespace character after the `let`, lines 2-4 desugar to
{{{
let { x = case 1 of {};
0 -> False;
_ -> True
};
}}}
Lines 3 and 4 need to be indented by at least one more space for the
intended meaning.
(It may help to recall that
{{{
main = do
let x = 1
y = 2
print x
}}}
is valid syntax.)
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9581#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list