Open ljmf00-wekaio opened 1 month ago
I've seen other weird issues on compiler upgrades at Weka codebase, with type implicit conversions, so compiler certainly got weirder.
e.g. switch
cases with string
are no longer CTFEable with null
, as it now says null
of typetypeof(null)
is not implicitly convertible to type string
, which, in reality, it is. Non CTFE compilation works, but for other types implicit conversion got broken too.
Need to find a simple testcase to report to issues.dlang.org
.
@JohanEngelen can confirm these evidences.
The only recent change to std.sumtype
is https://github.com/dlang/phobos/pull/8933
So, my predictions is that there's some regression in the compiler. I'll try to prove it.
@ljmf00-wekaio Do you have test case that I can compile? What argparse version do you use? What OS?
PS I checked both 1.37.0 and 1.38.0 in CI build and everything was successfully built.
@ljmf00-wekaio It appears to be related by wtracer's own implementation of SumType
. If I remove that code and use std.sumtype.SumType
instead, things do compile again after commenting-out code that uses typeIndex
(Phobos's std.sumtype.SumType
does not expose tag
/typeIndex
)...
Edit: it is very strange that you cannot ask a SumType what type it holds... So I don't know how to rewrite the code that uses typeIndex
.
@JohanEngelen Thanks for the investigating it! oh, so its not failing on argparse
then? Should we close this here then?
@JohanEngelen I can't see why this is own SumType implementation tho, the path is .../import/std/sumtype.d
, see the errors:
/opt/hostedtoolcache/ldc2/1.38.0/x64/ldc2-1.38.0-linux-x86_64/bin/../import/std/sumtype.d(418): Error: template instance `DeducedParameterType!(inout(Unknown))` does not match template declaration `DeducedParameterType(T)`
/opt/hostedtoolcache/ldc2/1.38.0/x64/ldc2-1.38.0-linux-x86_64/bin/../import/std/sumtype.d(418): Error: template instance `DeducedParameterType!(inout(Argument))` does not match template declaration `DeducedParameterType(T)`
/opt/hostedtoolcache/ldc2/1.38.0/x64/ldc2-1.38.0-linux-x86_64/bin/../import/std/sumtype.d(418): Error: template instance `DeducedParameterType!(inout(SubCommand))` does not match template declaration `DeducedParameterType(T)`
/opt/hostedtoolcache/ldc2/1.38.0/x64/ldc2-1.38.0-linux-x86_64/bin/../import/std/sumtype.d(418): Error: template instance `DeducedParameterType!(inout(Unknown))` does not match template declaration `DeducedParameterType(T)`
/opt/hostedtoolcache/ldc2/1.38.0/x64/ldc2-1.38.0-linux-x86_64/bin/../import/std/sumtype.d(418): Error: template instance `DeducedParameterType!(inout(Argument))` does not match template declaration `DeducedParameterType(T)`
/opt/hostedtoolcache/ldc2/1.38.0/x64/ldc2-1.38.0-linux-x86_64/bin/../import/std/sumtype.d(418): Error: template instance `DeducedParameterType!(inout(SubCommand))` does not match template declaration `DeducedParameterType(T)`
/opt/hostedtoolcache/ldc2/1.38.0/x64/ldc2-1.38.0-linux-x86_64/bin/../import/std/sumtype.d(418): Error: template instance `DeducedParameterType!(inout(Unknown))` does not match template declaration `DeducedParameterType(T)`
/opt/hostedtoolcache/ldc2/1.38.0/x64/ldc2-1.38.0-linux-x86_64/bin/../import/std/sumtype.d(418): Error: template instance `DeducedParameterType!(inout(Argument))` does not match template declaration `DeducedParameterType(T)`
Unknown
, SubCommand
and Argument
are also types from argparse
. Also, this seem to only trigger on release prechecks:
Debug precheck (x86_64)...
Release precheck (x86_64)...
<errors>
It could be related to some compiler bug where it mistakes one sumtype for the other, or does something else weird... Perhaps I should just dustmite and see what comes out.
This is almost probably a compiler/Phobos regression. CC @pbackus perhaps are you aware of some change on sumtype that affected this? There's no other informational error, so, I can't understand clearly where the issue resides exactly. All I have is this log, and I'm confident its from
argparse
given the type names: