
@simonpj thanks for pointing me to this ticket.
The problem is in TcPat.find_field_ty but I can't see how to cleanly fix it.
@mpickering part of the fix is surely to compare the selector names (which we have available). I've implemented this in 52110a7966848538583acb65f6e064aadc751260 and it fixes the original test case.
However, the related bug #13847 remains: this patch is too liberal as it accepts examples where the field label is in scope only qualified, but it is used unqualified, and `DisambiguateRecordFields` is not enabled. Several of the other related bugs demonstrate this, so my patch causes
#13644: overloaded name used in record pattern matching leads to panic! (the 'impossible' happened) in ghc -------------------------------------+------------------------------------- Reporter: pjljvdlaar | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.4.1 Component: Compiler | Version: 8.0.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: #13840, #13973, | Differential Rev(s): #14087 | Wiki Page: | -------------------------------------+------------------------------------- Comment (by mpickering): Replying to [comment:16 adamgundry]: them to be accepted (without a panic, but without an error either).
I'm out of time to investigate further for now, unfortunately.
Is it not currently implemented like it is to enabled ORF to work properly? I think your patch changes it back to how it used to work? I can possibly try to create a test case tomorrow. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13644#comment:18 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler