[GHC] #11662: Regression using NamedFieldPuns with qualified field names

#11662: Regression using NamedFieldPuns with qualified field names -------------------------------------+------------------------------------- Reporter: hesselink | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1-rc2 Keywords: | 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: -------------------------------------+------------------------------------- I found a regression where code using the NamedFieldPuns extension and qualified field names doesn't compile with GHC 8 rc2, where it did with GHC 7.10. Minimal reproduction: {{{#!hs module Rec where data Rec = Rec { f :: Integer } -------------------- {-# LANGUAGE NamedFieldPuns #-} module Main where import Rec (Rec (Rec)) import qualified Rec g :: Rec -> Integer g (Rec { Rec.f }) = f }}} On GHC 8 this fails with: {{{ Main.hs:6:10: error: Qualified name in binding position: Rec.f }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11662 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11662: Regression using NamedFieldPuns with qualified field names -------------------------------------+------------------------------------- Reporter: hesselink | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1-rc2 Resolution: | Keywords: 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 hesselink): One more addition: I'm pretty sure now that this is supposed to work (and wasn't an accidental feature), since the documentation states {{{ A pun on a qualified field name is expanded by stripping off the module qualifier. }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11662#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11662: Regression using NamedFieldPuns with qualified field names -------------------------------------+------------------------------------- Reporter: hesselink | Owner: Type: bug | Status: new Priority: highest | Milestone: 8.0.1 Component: Compiler | Version: 8.0.1-rc2 (Parser) | Resolution: | Keywords: 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: | -------------------------------------+------------------------------------- Changes (by bgamari): * cc: adamgundry (added) * priority: normal => highest * component: Compiler => Compiler (Parser) * milestone: => 8.0.1 Comment: Indeed, it seems to me like this should work. It seems likely that this is due to the rework surrounding record selectors which accompanied `DuplicateRecordFields`. Ccing Adam. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11662#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11662: Regression using NamedFieldPuns with qualified field names -------------------------------------+------------------------------------- Reporter: hesselink | Owner: adamgundry Type: bug | Status: new Priority: highest | Milestone: 8.0.1 Component: Compiler | Version: 8.0.1-rc2 (Parser) | Resolution: | Keywords: 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: | -------------------------------------+------------------------------------- Changes (by adamgundry): * owner: => adamgundry Comment: Sounds plausible. I'll take a look. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11662#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11662: Regression using NamedFieldPuns with qualified field names -------------------------------------+------------------------------------- Reporter: hesselink | Owner: adamgundry Type: bug | Status: patch Priority: highest | Milestone: 8.0.1 Component: Compiler | Version: 8.0.1-rc2 (Parser) | Resolution: | Keywords: ORF Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: GHC rejects | Test Case: valid program | rename/should_compile/T11662 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1965 Wiki Page: | -------------------------------------+------------------------------------- Changes (by adamgundry): * keywords: => ORF * status: new => patch * differential: => Phab:D1965 * testcase: => rename/should_compile/T11662 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11662#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11662: Regression using NamedFieldPuns with qualified field names
-------------------------------------+-------------------------------------
Reporter: hesselink | Owner: adamgundry
Type: bug | Status: patch
Priority: highest | Milestone: 8.0.1
Component: Compiler | Version: 8.0.1-rc2
(Parser) |
Resolution: | Keywords: ORF
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: GHC rejects | Test Case:
valid program | rename/should_compile/T11662
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D1965
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#11662: Regression using NamedFieldPuns with qualified field names -------------------------------------+------------------------------------- Reporter: hesselink | Owner: adamgundry Type: bug | Status: merge Priority: highest | Milestone: 8.0.1 Component: Compiler | Version: 8.0.1-rc2 (Parser) | Resolution: | Keywords: ORF Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: GHC rejects | Test Case: valid program | rename/should_compile/T11662 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1965 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => merge -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11662#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11662: Regression using NamedFieldPuns with qualified field names -------------------------------------+------------------------------------- Reporter: hesselink | Owner: adamgundry Type: bug | Status: closed Priority: highest | Milestone: 8.0.1 Component: Compiler | Version: 8.0.1-rc2 (Parser) | Resolution: fixed | Keywords: ORF Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: GHC rejects | Test Case: valid program | rename/should_compile/T11662 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1965 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed Comment: Merged to `ghc-8.0` as da69d6710f69bdb8b4864f354ab9b8bdcb0167e8. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11662#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC