[GHC] #15720: Assign to literals is allowed in ghci

GHC ghc-devs at haskell.org
Mon Oct 8 03:10:32 UTC 2018


#15720: Assign to literals is allowed in ghci
-------------------------------------+-------------------------------------
        Reporter:  sighingnow        |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  GHCi              |              Version:  8.6.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  GHC accepts       |  Unknown/Multiple
  invalid program                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by goldfire):

 This should perhaps be an on-by-default warning, but it's valid Haskell
 code. `1 = 2` is a lazy pattern match. Because it's lazy but binds no
 variables, we never see an error reported. This is maybe silly, but it
 doesn't quite seem worth putting another rule in Haskell to avoid this
 possibility.

 That said, a pattern-match that binds no variables is warned by `-Wunused-
 pattern-binds`; maybe this should really be its own warning.

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


More information about the ghc-tickets mailing list