Ticket #68 (closed feature request: wontfix)

Opened 11 years ago

Last modified 21 months ago

Warnings for unitialized fields

Reported by: nobody Owned by:
Priority: normal Milestone: _|_
Component: Compiler Version: None
Keywords: warnings Cc: stefan@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty: Easy (less than 1 hour)
Test Case: Blocked By:
Blocking: Related Tickets:

Description (last modified by simonmar) (diff)

Would it be possible to add flag to disable warnings for unitialized fields just when using constructor with zero fields? I mean, if I use

  Foo {}

to construct empty record, it is a bit unpleasant that I get flooded by dozens of useless warnings; but I don't want to disable them -- they are useful when I forget to initialize some field(s).

Zdenek Dvorak

Attachments

unitialized_waring.dpatch Download (95.5 KB) - added by ste 2 years ago.
A proposition for this feature request

Change History

Changed 7 years ago by simonmar

  • type changed from support request to feature request
  • component changed from None to Compiler
  • description modified (diff)

Changed 7 years ago by igloo

  • keywords warnings added
  • difficulty set to Easy (1 hr)
  • os set to Unknown
  • architecture set to Unknown
  • milestone set to _|_

Changed 5 years ago by simonmar

  • architecture changed from Unknown to Unknown/Multiple

Changed 5 years ago by simonmar

  • os changed from Unknown to Unknown/Multiple

Changed 4 years ago by igloo

  • owner nobody deleted
  • status changed from assigned to new

Changed 4 years ago by simonmar

  • difficulty changed from Easy (1 hr) to Easy (less than 1 hour)

Changed 4 years ago by simonmar

  • failure set to None/Unknown
  • description modified (diff)

Not clear if this is a good idea, but we'll leave it here anyway.

Changed 2 years ago by ste

A proposition for this feature request

Changed 2 years ago by ste

  • cc stefan@… added
  • status changed from new to infoneeded

To get started with ghc hacking I created this patch. If this patch (or something similar) should be added to ghc, just tell me and I will add the necessary documentation and test cases. (This patch breaks test case ds041.hs due to a changed warning text.)

Changed 2 years ago by simonpj

Thanks for contriubting a patch.

However, I'm not clear of the original intent here. Consider

data T = T { x,y::Int }
f = T { x = 3 }
g = T {}

It would be very odd to get a warning from f but not from g. I'm not sure this is what the original requester was asking. I thought he didn't want a warning when T had zero fields -- and indeed you don't get a warning then.

Puzzled.

Simon

Changed 21 months ago by igloo

  • status changed from infoneeded to closed
  • resolution changed from None to wontfix

There doesn't seem to be a consensus that anything should be done, so I'm closing this ticket.

Note: See TracTickets for help on using tickets.