|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0000526||mercury||Bug||public||2020-11-11 11:34||2021-04-28 11:17|
|Target Version||Fixed in Version|
|Summary||0000526: unused imports affected by opt-imported typeclass instances|
|Description||Some basic investigation of why warnings/bug412.m fails when intermodule optimisation is enabled.|
The `io' module is considered used because polymorphism adds a typeclass info to the constant structure database due to opt-imported typeclass instances. Then const_struct_used_modules treats every constant structure as a use:
const_struct_used_modules(_ConstNum - ConstStruct, !UsedModules) :-
% Every const_struct in the const_struct_db was put there because
% it is used in module. None of the uses can be in the interface.
|Tags||No tags attached.|
The obvious fix is to add a field to each entry to the const_struct_db
that says "does this entry come from the current module, or not?",
and then ignore the fields with "no" answers when it comes to computing
the set of used modules. The only nontrivial aspect I see is when
two or more const structs use a smaller const struct; the smaller
const struct should say "for this module" if any of its users also say so.
Do you see anything wrong with this approach?
I think your approach should work.
(Sorry for the late response; the notification was caught by GMail's spam filter.)
|Fixed by zs on 2021-01-23|
|2020-11-11 11:34||wangp||New Issue|
|2020-11-12 03:13||zs||Note Added: 0001124|
|2020-11-30 13:35||wangp||Note Added: 0001125|
|2021-04-28 11:17||wangp||Assigned To||=> wangp|
|2021-04-28 11:17||wangp||Status||new => resolved|
|2021-04-28 11:17||wangp||Resolution||open => fixed|
|2021-04-28 11:17||wangp||Note Added: 0001134|