[GHC] #16096: let x = ... and x = ... are not the same in GHCi

GHC ghc-devs at haskell.org
Wed Dec 26 05:16:18 UTC 2018


#16096: let x = ... and x = ... are not the same in GHCi
-------------------------------------+-------------------------------------
        Reporter:  osa1              |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  GHCi              |              Version:  8.6.3
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by osa1):

 The problem is this: in `GHCi.UI.runStmt` we use GHC's `parseStmt` to
 parse the statements. If the parser fails then we assume it's a
 declaration. For statements we do `run_stmt`, for decls we do `run_decl`.
 So effectively we compile `x = 1` as a top-level binding (a declaration)
 but `let x = 1` is compiled as if it's a `do` statement.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/16096#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list