[GHC] #14892: Field imposters with DuplicateRecordFields and NamedFieldPuns.

GHC ghc-devs at haskell.org
Mon Mar 5 17:33:38 UTC 2018


#14892: Field imposters with DuplicateRecordFields and NamedFieldPuns.
-------------------------------------+-------------------------------------
        Reporter:  philderbeast      |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.4.1-alpha3
      Resolution:                    |             Keywords:  ORF
Operating System:  MacOS X           |         Architecture:  x86_64
 Type of failure:  GHC accepts       |  (amd64)
  invalid program                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #13644            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by philderbeast):

 You beat me to the test with a later GHC version, something Ben asked me
 to do on #12158. I too am seeing the problem of GHC's panic fixed. I do
 wish however that the compiler here would pick the one `x` pun that fits.

 {{{
 # stack.yaml
 resolver: ghc-8.4.0.20180118
 compiler: ghc-8.4.0.20180118
 compiler-check: match-exact
 }}}

 {{{
 > stack build
 ghc-panic-translateConPatVec-lookup-0.1.0: build (lib)
 Preprocessing library for ghc-panic-translateConPatVec-lookup-0.1.0..
 Building library for ghc-panic-translateConPatVec-lookup-0.1.0..
 [2 of 3] Compiling GhcPanic12158

 /earth/library/GhcPanic12158.hs:9:12: error:
     • Constructor ‘G.X’ does not have field ‘x’
     • In the pattern: G.X {x}
       In an equation for ‘update’: update G.X {x} = G.X {x = x}
   |
 9 | update G.X{x} = G.X{x = x}
 }}}

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14892#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list