Mercury Bugs - mercury
View Issue Details
0000320mercuryBugpublic2014-02-19 16:122014-02-21 17:09
Reporterpbone 
Assigned Tojuliensf 
PrioritynormalSeverityminorReproducibilityalways
StatusfeedbackResolutionopen 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000320: instantiation states and "unused module import" warnings do not interact properly.
DescriptionA Mercury module containing a module import for some other Mercury module and an instantiation state deceleration for a type in that module but nothing else to do with that module generated an unused module import warning.
Steps To ReproduceCompile the attached module with "mmc -c", it should be warnings-clean but isn't. mmc outputs:

paul@oxygen> mmc -c unused_import_inst_bug.m
unused_import_inst_bug.m:001: In module `unused_import_inst_bug':
unused_import_inst_bug.m:001: warning: module `maybe' is imported in the
unused_import_inst_bug.m:001: interface, but is not used in the interface.
TagsNo tags attached.
Attached Files? unused_import_inst_bug.m (455) 2014-02-19 16:12
https://bugs.mercurylang.org/file_download.php?file_id=205&type=bug

Notes
(0000650)
juliensf   
2014-02-21 17:08   
The underlying problem here is most likely that insts don't have type information associated with them,
so the unused module checker cannot see that the inst maybe_yes refers to the functor yes/1.
(This is a much more general problem, see 0000089 for example -- it's also a language design issue, since
in order to resolve properly we would need to add some mechanism to add type information to insts.)

Issue History
2014-02-19 16:12pboneNew Issue
2014-02-19 16:12pboneFile Added: unused_import_inst_bug.m
2014-02-21 17:08juliensfNote Added: 0000650
2014-02-21 17:09juliensfAssigned To => juliensf
2014-02-21 17:09juliensfStatusnew => feedback