Bug 24686 – SumType stopped working on LDC 1.37 with unmatched DeducedParameterType template

Status
NEW
Severity
regression
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2024-07-26T19:15:46Z
Last change time
2024-12-01T16:42:52Z
Assigned to
No Owner
Creator
Luís Ferreira
Moved to GitHub: phobos#9875 →

Comments

Comment #0 by contact — 2024-07-26T19:15:46Z
Compiling an argument parser (cant really deduce the code snippet) 63874b2ce32b165436d3007515377ef5d5dce22d version of https://github.com/andrey-zherikov/argparse yields the following error on LDC 1.37 and beyond. ``` /home/luis/.local/bin/../import/std/sumtype.d(418): Error: template instance `DeducedParameterType!(inout(Unknown))` does not match template declaration `DeducedParameterType(T)` /home/luis/.local/bin/../import/std/sumtype.d(418): Error: template instance `DeducedParameterType!(inout(Argument))` does not match template declaration `DeducedParameterType(T)` /home/luis/.local/bin/../import/std/sumtype.d(418): Error: template instance `DeducedParameterType!(inout(SubCommand))` does not match template declaration `DeducedParameterType(T)` /home/luis/.local/bin/../import/std/sumtype.d(418): Error: template instance `DeducedParameterType!(inout(Unknown))` does not match template declaration `DeducedParameterType(T)` /home/luis/.local/bin/../import/std/sumtype.d(418): Error: template instance `DeducedParameterType!(inout(Argument))` does not match template declaration `DeducedParameterType(T)` /home/luis/.local/bin/../import/std/sumtype.d(418): Error: template instance `DeducedParameterType!(inout(SubCommand))` does not match template declaration `DeducedParameterType(T)` /home/luis/.local/bin/../import/std/sumtype.d(418): Error: template instance `DeducedParameterType!(inout(Unknown))` does not match template declaration `DeducedParameterType(T)` /home/luis/.local/bin/../import/std/sumtype.d(418): Error: template instance `DeducedParameterType!(inout(Argument))` does not match template declaration `DeducedParameterType(T)` /home/luis/.local/bin/../import/std/sumtype.d(418): Error: template instance `DeducedParameterType!(inout(SubCommand))` does not match template declaration `DeducedParameterType(T)` /home/luis/.local/bin/../import/std/sumtype.d(418): Error: template instance `DeducedParameterType!(inout(Unknown))` does not match template declaration `DeducedParameterType(T)` /home/luis/.local/bin/../import/std/sumtype.d(418): Error: template instance `DeducedParameterType!(inout(Argument))` does not match template declaration `DeducedParameterType(T)` /home/luis/.local/bin/../import/std/sumtype.d(418): Error: template instance `DeducedParameterType!(inout(SubCommand))` does not match template declaration `DeducedParameterType(T)` /home/luis/.local/bin/../import/std/sumtype.d(418): Error: template instance `DeducedParameterType!(inout(Unknown))` does not match template declaration `DeducedParameterType(T)` /home/luis/.local/bin/../import/std/sumtype.d(418): Error: template instance `DeducedParameterType!(inout(Argument))` does not match template declaration `DeducedParameterType(T)` /home/luis/.local/bin/../import/std/sumtype.d(418): Error: template instance `DeducedParameterType!(inout(SubCommand))` does not match template declaration `DeducedParameterType(T)` /home/luis/.local/bin/../import/std/sumtype.d(418): Error: template instance `DeducedParameterType!(inout(Unknown))` does not match template declaration `DeducedParameterType(T)` /home/luis/.local/bin/../import/std/sumtype.d(418): Error: template instance `DeducedParameterType!(inout(Argument))` does not match template declaration `DeducedParameterType(T)` /home/luis/.local/bin/../import/std/sumtype.d(418): Error: template instance `DeducedParameterType!(inout(SubCommand))` does not match template declaration `DeducedParameterType(T)` /home/luis/.local/bin/../import/std/sumtype.d(418): Error: template instance `DeducedParameterType!(inout(Unknown))` does not match template declaration `DeducedParameterType(T)` /home/luis/.local/bin/../import/std/sumtype.d(418): Error: template instance `DeducedParameterType!(inout(Argument))` does not match template declaration `DeducedParameterType(T)` ``` Turns out `DeducedParameterType` doesn't accept aliased types. Ultimately this should be a compiler issue, in my understanding of the language spec, as T and alias T shouldn't differ for types, but somehow it does. Making `DeducedParameterType` accepting aliased types, works.
Comment #1 by robert.schadek — 2024-12-01T16:42:52Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/9875 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB