[GHC] #10520: RecordWildCards causes “is not a (visible) field of constructor” in ghci
#10520: RecordWildCards causes “is not a (visible) field of constructor” in ghci -------------------------------------+------------------------------------- Reporter: ion1 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.10.1 Keywords: | Operating System: Linux RecordWildCards | Type of failure: GHC rejects Architecture: x86_64 | valid program (amd64) | Blocked By: Test Case: | Related Tickets: Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- {{{ % ghc -ignore-dot-ghci -e 'data Foo = Bar { baz :: Integer } deriving Show' -e 'Bar 42' -e '(Bar 42){ baz = 43 }' -e 'Bar { baz = 42 }' Bar {baz = 42} Bar {baz = 43} Bar {baz = 42} }}} {{{ % ghc -ignore-dot-ghci -XRecordWildCards -e 'data Foo = Bar { baz :: Integer } deriving Show' -e 'Bar 42' -e '(Bar 42){ baz = 43 }' -e 'Bar { baz = 42 }' Bar {baz = 42} Bar {baz = 43} <interactive>:1:7: ‘baz’ is not a (visible) field of constructor ‘Bar’ }}} {{{ % ghc --version The Glorious Glasgow Haskell Compilation System, version 7.10.1 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10520> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10520: RecordWildCards causes “is not a (visible) field of constructor” in ghci -------------------------------------+------------------------------------- Reporter: ion1 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.10.1 Resolution: | Keywords: Operating System: Linux | RecordWildCards Type of failure: GHC rejects | Architecture: x86_64 valid program | (amd64) Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by Simon Peyton Jones <simonpj@…>): In [changeset:"a3f6239d905ad4b8fb597f43bd4ef9947c83362f/ghc"]: {{{ #!CommitTicketReference repository="ghc" revision="a3f6239d905ad4b8fb597f43bd4ef9947c83362f" GHCi: fix scoping for record selectors This fixes Trac #10520. See the "Ugh" note about record selectors in HscTypes.icExtendGblRdrEnv. }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10520#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10520: RecordWildCards causes “is not a (visible) field of constructor” in ghci -------------------------------------+------------------------------------- Reporter: ion1 | Owner: Type: bug | Status: merge Priority: normal | Milestone: 7.10.3 Component: GHCi | Version: 7.10.1 Resolution: | Keywords: Operating System: Linux | RecordWildCards Type of failure: GHC rejects | Architecture: x86_64 valid program | (amd64) Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by simonpj): * status: new => merge * milestone: => 7.10.3 Comment: Thanks for the report. Hopefully can merge into 7.10.3 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10520#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10520: RecordWildCards causes “is not a (visible) field of constructor” in ghci -------------------------------------+------------------------------------- Reporter: ion1 | Owner: Type: bug | Status: closed Priority: normal | Milestone: 7.10.3 Component: GHCi | Version: 7.10.1 Resolution: fixed | Keywords: | RecordWildCards Operating System: Linux | Architecture: x86_64 Type of failure: GHC rejects | (amd64) valid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed Comment: This was merged to `ghc-7.10` as f71f770. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10520#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10520: RecordWildCards causes “is not a (visible) field of constructor” in ghci -------------------------------------+------------------------------------- Reporter: ion1 | Owner: Type: bug | Status: closed Priority: normal | Milestone: 7.10.3 Component: GHCi | Version: 7.10.1 Resolution: fixed | Keywords: | RecordWildCards Operating System: Linux | Architecture: x86_64 Type of failure: GHC rejects | (amd64) valid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed Comment: I'm afraid this isn't entirely trivial to backport as it requires 9b73cb16485f331d9dc1f37826c6d503e24a5b0b which is a rather major rework. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10520#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10520: RecordWildCards causes “is not a (visible) field of constructor” in ghci -------------------------------------+------------------------------------- Reporter: ion1 | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.0.1 Component: GHCi | Version: 7.10.1 Resolution: fixed | Keywords: | RecordWildCards Operating System: Linux | Architecture: x86_64 Type of failure: GHC rejects | (amd64) valid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * milestone: 7.10.3 => 8.0.1 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10520#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10520: RecordWildCards causes “is not a (visible) field of constructor” in ghci -------------------------------------+------------------------------------- Reporter: ion1 | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.0.1 Component: GHCi | Version: 7.10.1 Resolution: fixed | Keywords: | RecordWildCards Operating System: Linux | Architecture: x86_64 Type of failure: GHC rejects | (amd64) valid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"cd85dc84b36bc5f600eb1b3805024a5b2443e1a3/ghc" cd85dc84/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="cd85dc84b36bc5f600eb1b3805024a5b2443e1a3" Make sure record pattern synonym selectors are in scope in GHCi. Beforehand, when a record pattern synonym was defined in GHCi the selectors would not be in scope. This is because of `is_sub_bndr` in `HscTypes.icExtendGblRdrEnv` was throwing away the selectors. This was broken by the fix to #10520 but it is easy to resolve. Reviewers: austin, bgamari, simonpj Reviewed By: simonpj Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2147 GHC Trac Issues: #11985 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10520#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC