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

#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

#12681: Missing fields warning when qualified records are initialized with unqualified field names -------------------------------------+------------------------------------- Reporter: lyxia | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: fixed | 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: | -------------------------------------+------------------------------------- Changes (by simonpj): * status: new => closed * resolution: => fixed Comment: I have not tried the released 8.0.1, but the 8.0 branch and HEAD both say {{{ T12681.hs:4:17: error: Not in scope: ‘a’ Perhaps you meant ‘T12681a.a’ (imported from T12681a) }}} which is quite reasonable. (I renamed the modules involved.) So it looks as if this one is fine. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12681#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12681: Missing fields warning when qualified records are initialized with
unqualified field names
-------------------------------------+-------------------------------------
Reporter: lyxia | Owner:
Type: bug | Status: closed
Priority: normal | Milestone:
Component: Compiler | Version: 8.0.1
Resolution: fixed | 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: |
-------------------------------------+-------------------------------------
Comment (by Simon Peyton Jones
participants (1)
-
GHC