[GHC] #14588: GHC 8.2.1 allows bang patterns in let-bindings without -XBangPatterns
#14588: GHC 8.2.1 allows bang patterns in let-bindings without -XBangPatterns -------------------------------------+------------------------------------- Reporter: kmiyazato | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 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: -------------------------------------+------------------------------------- Bang patterns occurring in let-bindings are allowed even if -XBangPatterns extension is not enabled. {{{#!hs -- Compile error in 8.0.2 -- Compiles in 8.2.1 and 8.2.2 main = print (let !x = 1 + 2 in x) }}} {{{#!hs -- Compile error in all of 8.0.2, 8.2.1, and 8.2.2 main = print (let f !x !y = x + y in f 1 2) }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14588> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#14588: GHC 8.2.1 allows bang patterns in let-bindings without -XBangPatterns -------------------------------------+------------------------------------- Reporter: kmiyazato | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.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: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * cc: bgamari (added) Comment: This behavior was introduced in 372995364c52eef15066132d7d1ea8b6760034e6 (`Treat banged bindings as FunBinds`). -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14588#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#14588: GHC 8.2.1 allows bang patterns in let-bindings without -XBangPatterns -------------------------------------+------------------------------------- Reporter: kmiyazato | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 8.2.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): Phab:D4270 Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => patch * differential: => Phab:D4270 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14588#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#14588: GHC 8.2.1 allows bang patterns in let-bindings without -XBangPatterns -------------------------------------+------------------------------------- Reporter: kmiyazato | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 8.2.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): Phab:D4270 Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): The sort of things that sneak through our testsuite never ceases to amaze me. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14588#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#14588: GHC 8.2.1 allows bang patterns in let-bindings without -XBangPatterns -------------------------------------+------------------------------------- Reporter: kmiyazato | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 8.2.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): Phab:D4270 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ryan Scott <ryan.gl.scott@…>): In [changeset:"9caf40e9d7233a2a6e78a0c4f2d2f13acbf804dd/ghc" 9caf40e9/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="9caf40e9d7233a2a6e78a0c4f2d2f13acbf804dd" Fix #14588 by checking for more bang patterns Summary: Commit 372995364c52eef15066132d7d1ea8b6760034e6 inadvertently removed a check in the parser which rejected let-bindings with bang patterns, leading to #14588. This fixes it by creating a `hintBangPat` function to perform this check, and sprinkling it in the right places. Test Plan: make test TEST=T14588 Reviewers: bgamari, alanz, simonpj Reviewed By: bgamari, simonpj Subscribers: rwbarton, thomie, mpickering, carter GHC Trac Issues: #14588 Differential Revision: https://phabricator.haskell.org/D4270 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14588#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#14588: GHC 8.2.1 allows bang patterns in let-bindings without -XBangPatterns -------------------------------------+------------------------------------- Reporter: kmiyazato | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: GHC accepts | Test Case: invalid program | parser/should_fail/T14588 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4270 Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * testcase: => parser/should_fail/T14588 * status: patch => closed * resolution: => fixed -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14588#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC