SumType!(A,B) != SumType!(B,A) - a bug?
Paul Backus
snarwin at gmail.com
Tue Dec 26 20:05:22 UTC 2023
On Tuesday, 26 December 2023 at 19:30:14 UTC, Andrey Zherikov
wrote:
> On Tuesday, 26 December 2023 at 19:19:08 UTC, Paul Backus wrote:
>> I think this is probably a compiler bug, but it's hard to tell
>> without a reduced example.
>
> Output from dustmite:
>
> ```d
> void main()
> {
> import std;
> struct B { int[] i; }
>
> immutable s2 = SumType!B(B.init); // compilation error
> }
> ```
Needs to include `std.sumtype` in the reduction to be useful. I
recommend copying `sumtype.d` from Phobos to a new directory to
create a self-contained example.
More information about the Digitalmars-d
mailing list