Opened 3 years ago

Closed 3 years ago

#7454 closed bug (fixed)

Missing warning about redundant import of classes/types whose members are used

Reported by: EyalLotem Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.6.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case: rename/should_fail/T7454
Blocked By: Blocking:
Related Tickets: Differential Revisions:

Description

If one module exports a class C(..) with a method m, and another module imports it via: import Module(C, m) And then proceeds to use only "m", one would expect to get a warning about the redundant import of "C", but that does not occur.

Similarly, the same thing happens if one imports a data-type "D", and a record field "f", and uses only "f". No redundant import warning is issued on D.

Change History (3)

comment:1 Changed 3 years ago by simonpj@…

commit afe9a3b0f1a28c364e8574c7d26962f89dd9806e

Author: Simon Peyton Jones <[email protected]>
Date:   Mon Jan 7 17:52:08 2013 +0000

    Remove two unused imports, detected by the fix to Trac #7454

 compiler/basicTypes/Id.lhs  |    2 +-
 compiler/typecheck/Inst.lhs |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

comment:2 Changed 3 years ago by simonpj@…

commit a8ea80f19974abc4f1b18734013873292116fff5

Author: Simon Peyton Jones <[email protected]>
Date:   Mon Jan 7 17:50:57 2013 +0000

    Rearrange the computation of unused imports; fixes Trac #7454

 compiler/rename/RnNames.lhs |   44 +++++++++++++++++++++++++++++-------------
 1 files changed, 30 insertions(+), 14 deletions(-)

comment:3 Changed 3 years ago by simonpj

  • difficulty set to Unknown
  • Resolution set to fixed
  • Status changed from new to closed
  • Test Case set to rename/should_fail/T7454

Thanks! Fixed by above patch.

Note: See TracTickets for help on using tickets.