[GHC] #14747: DisambiguateRecordFields fails for PatternSynonyms

#14747: DisambiguateRecordFields fails for PatternSynonyms -------------------------------------+------------------------------------- Reporter: adamgundry | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 (Type checker) | Keywords: | Operating System: Unknown/Multiple PatternSynonyms | Architecture: | Type of failure: GHC rejects Unknown/Multiple | valid program Test Case: | Blocked By: Blocking: | Related Tickets: #11283 Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Consider: {{{#!hs {-# LANGUAGE PatternSynonyms #-} module A where pattern S{x} = [x] }}} {{{#!hs {-# LANGUAGE PatternSynonyms, DisambiguateRecordFields #-} module B where import A pattern T{x} = [x] e = S { x = 42 } }}} Compiling module B fails with `Ambiguous occurrence ‘x’` in the definition of `e`. In principle, `DisambiguateRecordFields` should select the field belonging to the `S` "data constructor". However, the current implementation of this works by identifying the parent type constructor, which doesn't exist for a pattern synonym. This continues to fail if `T` is replaced by a data type with a field `x`. If `S` is replaced by a data type, however, it starts working. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14747 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14747: DisambiguateRecordFields fails for PatternSynonyms -------------------------------------+------------------------------------- Reporter: adamgundry | Owner: adamgundry Type: bug | Status: new Priority: normal | Milestone: Component: Compiler (Type | Version: 8.2.1 checker) | Keywords: Resolution: | PatternSynonyms Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: #11283, #15149 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by adamgundry): * owner: (none) => adamgundry * related: #11283 => #11283, #15149 Comment: #15149 outlines a plan that should allow fixing this. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14747#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14747: DisambiguateRecordFields fails for PatternSynonyms -------------------------------------+------------------------------------- Reporter: adamgundry | Owner: adamgundry Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler (Type | Version: 8.2.1 checker) | Keywords: Resolution: | PatternSynonyms Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: GHC rejects | Test Case: valid program | rename/should_compile/T14747 Blocked By: | Blocking: Related Tickets: #11283, #15149 | Differential Rev(s): Phab:D4821 Wiki Page: | -------------------------------------+------------------------------------- Changes (by adamgundry): * status: new => patch * testcase: => rename/should_compile/T14747 * differential: => Phab:D4821 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14747#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14747: DisambiguateRecordFields fails for PatternSynonyms
-------------------------------------+-------------------------------------
Reporter: adamgundry | Owner: adamgundry
Type: bug | Status: patch
Priority: normal | Milestone:
Component: Compiler (Type | Version: 8.2.1
checker) | Keywords:
Resolution: | PatternSynonyms
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: GHC rejects | Test Case:
valid program | rename/should_compile/T14747
Blocked By: | Blocking:
Related Tickets: #11283, #15149 | Differential Rev(s): Phab:D4821
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#14747: DisambiguateRecordFields fails for PatternSynonyms -------------------------------------+------------------------------------- Reporter: adamgundry | Owner: adamgundry Type: bug | Status: closed Priority: normal | Milestone: 8.6.1 Component: Compiler (Type | Version: 8.2.1 checker) | Keywords: Resolution: fixed | PatternSynonyms Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: GHC rejects | Test Case: valid program | rename/should_compile/T14747 Blocked By: | Blocking: Related Tickets: #11283, #15149 | Differential Rev(s): Phab:D4821 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed * milestone: => 8.6.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14747#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC