Missing fields warning when qualified records are initialized with unqualified field names
The following code leads to a misleading warning.
-- 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}
Trac metadata
| Trac field | Value |
|---|---|
| Version | 8.0.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture |