Ticket #2843 (closed bug: fixed)

Opened 3 years ago

Last modified 3 years ago

Missing "Defined but not used" for recursive expressions

Reported by: guest Owned by:
Priority: normal Milestone:
Component: Compiler Version: 6.8.2
Keywords: Cc: ghc@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

a :: Int
a =
  let b = "foo"++b
  in  42

In this example b is not really used, but there is no warning by GHC. I assume this is so because b calls itself. If I remove ++b then I get the warning as expected.

(This reminds on the difference between a purely reference counting garbage collector and a correct one.)

Change History

Changed 3 years ago by igloo

  • status changed from new to closed
  • difficulty set to Unknown
  • resolution set to fixed

Thanks for the report. Happily, 6.10.1 (and the HEAD) already warns about this correctly:

b.hs:4:6: Warning: Defined but not used: `b'
Note: See TracTickets for help on using tickets.