id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,os,architecture,failure,difficulty,testcase,blockedby,blocking,related
5334,record wildcards: field not initialised reported as type error,aruiz,simonpj,"I think that the following program should be accepted, with warnings about not initialized fields:

{{{
{-# LANGUAGE RecordWildCards #-}

data T = T { a, b :: Int }

t = T {..}
  where
     a = 1
     -- b = 2

data S = S { x, y :: Int }

s = S { x = 1 }

}}}

but it produces 

{{{
$ ghci bugrecord.hs
GHCi, version 7.0.4: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package ffi-1.0 ... linking ... done.
[1 of 1] Compiling Main             ( bugrecord.hs, interpreted )

bugrecord.hs:5:5:
    Couldn't match expected type `Int' with actual type `T -> Int'
    In the `b' field of a record
    In the expression: T {..}
    In an equation for `t':
        t = T {..}
          where
              a = 1
Failed, modules loaded: none.
}}}

If we uncomment the definition of field b the program is accepted, with a correct warning about the undefined field y in the other record.
",bug,closed,normal,,Compiler,7.0.4,fixed,,,Unknown/Multiple,Unknown/Multiple,GHC rejects valid program,,,,,
