[GHC] #13470: Pattern synonyms bind variables out of scope
#13470: Pattern synonyms bind variables out of scope -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Keywords: | Operating System: Unknown/Multiple PatternSynonyms | Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Wasn't sure what to call this ticket: {{{#!hs {-# Language PatternSynonyms #-} pattern XInstrProxy :: (Bool -> Bool) -> a pattern XInstrProxy not <- _ }}} This works fine, is it intended? It came as some surprise to me when I was renaming type variables only to find it still working even though I hadn't changed the variable in the `ViewPattern` {{{#!hs import Data.Tagged pattern XInstrProxy proxy <- ((\(Proxy::Proxy descr) -> Proxy::Proxy (XInstr descr)) -> ty) }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13470> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13470: Pattern synonyms bind variables out of scope -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: | PatternSynonyms 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 dfeuer): * failure: None/Unknown => GHC accepts invalid program -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13470#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13470: Pattern synonyms bind variables out of scope -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: mpickering Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: | PatternSynonyms 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 mpickering): * owner: (none) => mpickering -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13470#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13470: Pattern synonyms bind variables out of scope -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: mpickering Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: | PatternSynonyms 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:D3377 Wiki Page: | -------------------------------------+------------------------------------- Changes (by mpickering): * status: new => patch * differential: => Phab:D3377 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13470#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13470: Pattern synonyms bind variables out of scope -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: mpickering Type: bug | Status: merge Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: | PatternSynonyms 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:D3377 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => merge * milestone: => 8.2.1 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13470#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13470: Pattern synonyms bind variables out of scope -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: | PatternSynonyms 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:D3377 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * owner: mpickering => (none) * status: merge => new -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13470#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13470: Pattern synonyms bind variables out of scope -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: mpickering Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: | PatternSynonyms 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:D3377 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * owner: (none) => mpickering -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13470#comment:6> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13470: Pattern synonyms bind variables out of scope -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: mpickering Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: | PatternSynonyms 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:D3377 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Matthew Pickering <matthewtpickering@…>): In [changeset:"d819e416a2a537b78b2698dfe753aa68dfb8b837/ghc" d819e41/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="d819e416a2a537b78b2698dfe753aa68dfb8b837" Only use locally bound variables in pattern synonym declarations Summary: We were using the unconstrainted `lookupOccRn` function which looked up any variable in scope. Instead we only want to consider variables brought into scope by renaming the pattern on the RHS. A few more changes to make reporting of unbound names suggest the correct things. Fixes #13470 Reviewers: simonpj, austin, bgamari Reviewed By: simonpj Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3377 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13470#comment:7> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13470: Pattern synonyms bind variables out of scope -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: mpickering Type: bug | Status: closed Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: fixed | Keywords: | PatternSynonyms Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: GHC accepts | Test Case: invalid program | patsyn/should_fail/T13470 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3377 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => closed * testcase: => patsyn/should_fail/T13470 * resolution: => fixed Comment: This is fixed by comment:7. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13470#comment:8> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC