On Sat, Nov 14, 2020 at 10:45:39AM +0100, Ralf Hemmecke wrote:
> Hello Waldek,
>
> during compilation of a package of mine, I get a warning. I think that
> this should not appear since I believe that everything is fine.
>
> Warnings:
> [1] findIdentity: not known that (QEtaAlgebra C) is of mode
> (CATEGORY domain (SIGNATURE * ($ C $)) (IF (has (Finite0Series C (QUOTE
> q) (Zero)) (QEtaGradedAlgebra C)) (ATTRIBUTE (QEtaGradedAlgebra C))
> noBranch) (IF (has (Finite0Series C (QUOTE q) (Zero)) (XEtaGradedAlgebra
> C)) (ATTRIBUTE (XEtaGradedAlgebra C)) noBranch))
>
> Clearly, it is hard for you to figure out where it comes from,
Well, message is generated in 'src/interp/c-util.boot' in
function 'extendsCategoryForm'. This function is called only
in few places, so it is clear "where it comes from".
> but the
> actual code is too big to post it here. Let me give more details. I
> actually would like to know whether you think that it is worth it to
> investigate further.
There are several warnings like above during build. They
are really compiler bug: compiler issues this warning when it
accepts code "on faith". There are tens of domains which
would not compile when the hole is removed. In some cases
with reasonable effort one could rewrite code so that it
is accepted by current compiler. But in many cases it is not
clear if reasonable workaround is possible.
Your example is iteresting, because actual failure looks
different than other examples.
Of course, proper fix is to modify compiler so that it
can correctly perform type checks, but that is "global"
problem, namely we need to collect type information in
proper places, store and propagate it etc. Currently
compiler has problem because some information is only
available at runtime and playes tricks to compute
what will happen at runtime before code is compiled
(this is hard problem, full and correct solution is
uncomputable). Unfortunatly, there are mismatches
between compile time and runtime representation of data.
'extendsCategoryForm' is particularly strongly
affected...
--
Waldek Hebisch