#11985 closed bug (fixed)

Core lint error on record syntax update/pattern synonym

Reported by: Iceland_jack Owned by: mpickering
Priority: normal Milestone: 8.2.1
Component: Compiler Version: 8.1
Keywords: PatternSynonyms Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s): Phab:D2147
Wiki Page:

Description

While on a flight I discovered some errors, if you load a file using record syntax for pattern synonyms:

module Foo where

pattern Pair{x, y} = (x, y)

and load it with -dcore-lint:

$ ghci -dcore-lint -ignore-dot-ghci -XPatternSynonyms /tmp/Foo.hs 
GHCi, version 8.1.20160419: http://www.haskell.org/ghc/  :? for help
[1 of 1] Compiling Foo              ( /tmp/Foo.hs, interpreted )
Ok, modules loaded: Foo.
*Foo> (1, 2) { x = 10 }
*** Core Lint errors : in result of desugar expression ***
    [...]

full error message attached.

Attachments (1)

Foo.log (3.2 KB) - added by Iceland_jack 18 months ago.

Download all attachments as: .zip

Change History (6)

Changed 18 months ago by Iceland_jack

Attachment: Foo.log added

comment:1 Changed 18 months ago by mpickering

This only happens when run in ghci.

comment:2 Changed 18 months ago by mpickering

Owner: set to mpickering

comment:3 Changed 18 months ago by mpickering

Differential Rev(s): Phab:D2147
Status: newpatch

comment:4 Changed 18 months ago by Ben Gamari <ben@…>

In cd85dc84/ghc:

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

comment:5 Changed 18 months ago by bgamari

Milestone: 8.2.1
Resolution: fixed
Status: patchclosed
Note: See TracTickets for help on using tickets.