Skip to content

Top-level RecordWildCards no longer working.

$ ghc -fforce-recomp /tmp/Damn.hs /tmp/T.hs
[1 of 2] Compiling Damn             ( /tmp/Damn.hs, /tmp/Damn.o )
[2 of 2] Compiling T                ( /tmp/T.hs, /tmp/T.o )

/tmp/T.hs:7:5: warning: [-Wmissing-fields]
     Fields of D.D not initialised: x, y
     In the expression: D.D {..}
      In an equation for d: d = D.D {..}
  |
7 | d = D.D {..}
  |     ^^^^^^^^

$ cat /tmp/Damn.hs /tmp/T.hs
module Damn (D(..)) where

data D = D { x :: Int, y :: () }
{-# LANGUAGE RecordWildCards #-}
module T where

import qualified Damn as D

d :: D.D
d = D.D {..}

x :: Int
x = 7

y :: ()
y = ()

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.2.1

Meanwhile on 8.0

$ ghc -Wall -fforce-recomp /tmp/Damn.hs /tmp/T.hs
[1 of 2] Compiling Damn             ( /tmp/Damn.hs, /tmp/Damn.o )
[2 of 2] Compiling T                ( /tmp/T.hs, /tmp/T.o )

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.0.2
Trac metadata
Trac field Value
Version 8.2.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information