Ticket #7169 (new feature request)
Warning for incomplete record field label used as function
| Reported by: | goldfire | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.8.1 |
| Component: | Compiler | Version: | 7.7 |
| Keywords: | Warnings | Cc: | the.dead.shall.rise@… |
| Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
| Type of failure: | None/Unknown | Difficulty: | Unknown |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description
Consider the following definition:
data Foo = Bar { frob :: Int }
| Baz { frob :: Int, quux :: Bool }
It would be great if GHC could produce a warning if I use quux as a function somewhere in my code, as calling quux on a Foo constructed with Bar will cause a runtime error. On the other hand, every use of frob is OK.
Currently, to find such problems, I have to first figure out which field labels are incomplete and then search for those, ignoring their uses as a proper field label (in construction or pattern matching).
Change History
Note: See
TracTickets for help on using
tickets.
