
#15149: Identical distinct type family fields miscompiled -------------------------------------+------------------------------------- Reporter: NeilMitchell | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.2 Resolution: | Keywords: ORF Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by adamgundry): I think this would work, and would amount to eliminating the distinction between `HsRecField` (containing `FieldOcc`) and `HsRecUpdField` (containing `AmbiguousFieldOcc`). At the moment, the former is used for record construction and pattern matching (fields always resolved by the renamer), while the latter is used for selection and update (ambiguous fields resolved by the type-checker). Here "ambiguous" really means "ambiguous from the renamer's perspective, but not necessarily the type- checker". It would probably be simpler to defer all field resolution to the type- checker, though we've also considered going in the opposite direction, and moving all field resolution back to the renamer (see https://github.com /ghc-proposals/ghc-proposals/pull/84). I'm not really sure which is better! There's an awkward corner if we were to defer all field resolution to the type-checker, which is that `Ambiguous` fields are not currently supported by `DsMeta`. That is, using them inside a TH bracket will fail with a "not supported" error. The basic problem is that `DsMeta` works on renamed syntax, even though it runs after type-checking. Would that be difficult to change? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15149#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler