
#14549: RecordWildCards doesn't work properly in repl -------------------------------------+------------------------------------- Reporter: akegalj | Owner: (none) Type: bug | Status: closed Priority: lowest | Milestone: Component: GHCi | Version: 8.2.1 Resolution: invalid | Keywords: repl, | recordwildcards Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by akegalj): * status: new => closed * resolution: => invalid Comment:
I guess the t1 = 2 shadows Test's declaration of t1, so you don't get a failure at that point. ah, yes. I didn't think of that it could be name shadowing. It would be clear to me if I got warning about shadowing but I guess that is suppressed by default in the repl as otherways people would be annoyed seeing that error all the time - as it is a common use case for repl to shadow a variable.
You might also get your code to work if you compiled the declaration for Test into a separate module yes, that's why I got confused with the repl as it was working with compiled module.
Thank you for a very detailed explanation - it makes perfect sense now. Closing -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14549#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler