sumtype 0.10.0: multiple dispatch

Paul Backus snarwin at gmail.com
Tue Oct 27 16:42:25 UTC 2020


On Tuesday, 27 October 2020 at 16:26:10 UTC, vitamin wrote:
>
> Hello,
>
> Older version of sumtype accept this code:
>
> void main(){
>     import sumtype;
>     alias Val = SumType!(bool);
>
>     const bool b = true;
>     Val val = b;  //fail in newest version
>     val = b;      //fail in newest version
> }
>
> but new version need exact type:
>
>
> void main(){
>     import sumtype;
>     alias Val = SumType!(bool);
>
>     bool b = true;   //cannot be const
>     Val val = b;
>     val = b;
> }
>
> is it bug in new version or old version?

It's a bug in the new version. Thanks for reporting. I've opened 
an issue on Github for this:

https://github.com/pbackus/sumtype/issues/47


More information about the Digitalmars-d-announce mailing list