Opened 3 years ago

Closed 3 years ago

#11336 closed bug (fixed)

GHC craches on this combination of ViewPatterns and PatternSynonyms

Reported by: baramoglo Owned by:
Priority: normal Milestone: 8.0.1
Component: Compiler Version: 7.10.2
Keywords: PatternSynonyms Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Compile-time crash Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


The attached file crashes:

$ ghc Bug.hs 
[1 of 1] Compiling Bug              ( Bug.hs, Bug.o )
ghc: panic! (the 'impossible' happened)
  (GHC version 7.10.2 for x86_64-unknown-linux):
	Prelude.last: empty list

I wasn't able to shrink the example further despite many attepts.

Tested on GHC 7.8.3 and 7.10.2.

Attachments (1)

Bug.hs (653 bytes) - added by baramoglo 3 years ago.

Download all attachments as: .zip

Change History (6)

Changed 3 years ago by baramoglo

Attachment: Bug.hs added

comment:1 Changed 3 years ago by baramoglo

Forgot to say that I'm able to work around the problem by changing the last line to

fun (Sym (prj -> Just B) :$ _) = undefined

So this is not a blocker for me.

comment:2 Changed 3 years ago by mpickering

Keywords: PatternSynonyms added

comment:3 Changed 3 years ago by simonpj

Happily this works in HEAD, and hence (I expect -- someone pls check) GHC 8.0.

I don't think we'll fix 7.10. Pattern synonyms have had a major re-work since then.


comment:4 Changed 3 years ago by Simon Peyton Jones <simonpj@…>

In 256c2cf/ghc:

Test Trac #11336

comment:5 Changed 3 years ago by bgamari

Milestone: 8.0.1
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.