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