Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#11283 closed bug (fixed)

PatternSynonms and DisambiguateRecordFields causes panic

Reported by: adamgundry Owned by: adamgundry
Priority: normal Milestone: 8.0.1
Component: Compiler Version: 7.11
Keywords: PatternSynonyms Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Compile-time crash Test Case: patsyn/should_compile/T11283
Blocked By: Blocking:
Related Tickets: #9975 Differential Rev(s): Phab:D1695
Wiki Page:


The following module causes a panic in HEAD:

{-# LANGUAGE PatternSynonyms, DisambiguateRecordFields #-}
data P a = MkP a
pattern S{x} = MkP x
e = S{x = 3}
ghc-stage2: panic! (the 'impossible' happened)
  (GHC version 7.11.20151223 for x86_64-unknown-linux):
  [S pattern synonym defined at PatSynBug.hs:3:1]

This is essentially the same bug as #9975; for some reason it became slightly harder to tickle. Fix incoming.

Change History (4)

comment:1 Changed 4 years ago by adamgundry

Differential Rev(s): Phab:D1695
Status: newpatch
Test Case: patsyn/should_compile/T11283

comment:2 Changed 4 years ago by Ben Gamari <ben@…>

In 4f69203d/ghc:

Fix panic when using pattern synonyms with DisambiguateRecordFields

This fixes a `find_tycon` panic when constructing a record pattern
synonym when `DisambiguateRecordFields` (turned on by `RecordWildCards`)
is enabled.  The handling of record wild cards in such constructions
isn't completely satisfactory, but doing better will require the
`Parent` type to be more informative, as I'll explain on #11228.

Test Plan: New test patsyn/should_compile/T11283.hs

Reviewers: mpickering, austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #11283

comment:3 Changed 4 years ago by bgamari

Resolution: fixed
Status: patchclosed

comment:4 Changed 4 years ago by thomie

Milestone: 8.0.1
Note: See TracTickets for help on using tickets.