[GHC] #12681: Missing fields warning when qualified records are initialized with unqualified field names

GHC ghc-devs at haskell.org
Mon Oct 10 08:35:35 UTC 2016


#12681: Missing fields warning when qualified records are initialized with
unqualified field names
-------------------------------------+-------------------------------------
           Reporter:  lyxia          |             Owner:
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.0.1
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  Incorrect
  Unknown/Multiple                   |  warning at compile-time
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 The following code leads to a misleading warning.

 {{{#!hs
 -- A.hs
 module A where
   data A = A { a :: Int }

 -- B.hs
 module B where
   import qualified A
   x = A.A { a = 0 }
 }}}


 GHC warns

 {{{
 A.hs:5:5: warning: [-Wmissing-fields]
     • Fields of ‘A.A’ not initialised: a
     • In the expression: A.A {a = 0}
       In an equation for ‘x’: x = A.A {a = 0}
 }}}

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


More information about the ghc-tickets mailing list