[GHC] #12489: undefined in view pattern inside pattern synonym causes GHC to panic

#12489: undefined in view pattern inside pattern synonym causes GHC to panic -------------------------------------+------------------------------------- Reporter: pkmx | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Compile-time Unknown/Multiple | crash Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- The following: {{{#!hs {-# LANGUAGE PatternSynonyms, ViewPatterns #-} pattern P :: a -> b pattern P a <- (undefined -> a) }}} causes GHC HEAD and 8.0.1 to panic: {{{ ghc: panic! (the 'impossible' happened) (GHC version 8.1.20160813 for x86_64-unknown-linux): StgCmmEnv: variable not found }}} Removing the pattern signature or moving `undefined` behind another name work however: {{{#!hs {-# LANGUAGE PatternSynonyms, ViewPatterns #-} bottom :: a bottom = undefined pattern P :: a -> b pattern P a <- (bottom -> a) -- OK! -- No type signature pattern P' a <- (undefined -> a) -- OK! }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12489 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12489: undefined in view pattern inside pattern synonym causes GHC to panic -------------------------------------+------------------------------------- Reporter: pkmx | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.1 Resolution: | Keywords: | PatternSynonyms Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by mpickering): * keywords: => PatternSynonyms -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12489#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12489: undefined in view pattern inside pattern synonym causes GHC to panic -------------------------------------+------------------------------------- Reporter: pkmx | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.1 Resolution: | Keywords: | PatternSynonyms Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by mpickering): This still happens in HEAD. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12489#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12489: undefined in view pattern inside pattern synonym causes GHC to panic
-------------------------------------+-------------------------------------
Reporter: pkmx | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.1
Resolution: | Keywords:
| PatternSynonyms
Operating System: Unknown/Multiple | Architecture:
Type of failure: Compile-time | Unknown/Multiple
crash | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Simon Peyton Jones

#12489: undefined in view pattern inside pattern synonym causes GHC to panic -------------------------------------+------------------------------------- Reporter: pkmx | Owner: Type: bug | Status: merge Priority: normal | Milestone: Component: Compiler | Version: 8.1 Resolution: | Keywords: | PatternSynonyms Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Compile-time | Test Case: crash | patsyn/should_compile/T12489 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonpj): * testcase: => patsyn/should_compile/T12489 * status: new => merge -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12489#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12489: undefined in view pattern inside pattern synonym causes GHC to panic
-------------------------------------+-------------------------------------
Reporter: pkmx | Owner:
Type: bug | Status: merge
Priority: normal | Milestone:
Component: Compiler | Version: 8.1
Resolution: | Keywords:
| PatternSynonyms
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: Compile-time | Test Case:
crash | patsyn/should_compile/T12489
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#12489: undefined in view pattern inside pattern synonym causes GHC to panic -------------------------------------+------------------------------------- Reporter: pkmx | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Resolution: fixed | Keywords: | PatternSynonyms Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Compile-time | Test Case: crash | patsyn/should_compile/T12489 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * version: 8.1 => 8.0.1 * resolution: => fixed * milestone: => 8.0.2 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12489#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC