Typechecking of SPECIALIZE of imported Ids with -fno-code / no unfoldings info
Currently the typechecker skips the typechecking of SPECIALIZE of imported Ids in case of
- NoBackend/Interpreter backend
- Unfolding info is not available
This may be undesirable as the typechecking should happen irrespective of the optimization and unfolding status of Ids.
When running with
-fno-code the SPECIALIZE should also get typechecked, and the warnings about them not having any impact due to unfoldings should happen in the desugarer (in case optimization is enabled)
In fact there is already a
DsUselessSpecialiseForNoInlineFunction message to warn user about "Ignoring useless SPECIALISE pragma for NOINLINE function:"
This issue is also closely related to the #14095, which does the typechecking of modules immediately after its dependencies have been typechecked and before the unfoldings info of the imported modules is available.