|
According to a comment by @louthy in the last post in this issue, we should be able to do this... var s1 = Some(10);
var s2 = Some(20);
var s3 = s1 + s2; // Some(30)That was posted back in Oct '15. I just tried this (using v4.0.3) and got a compiler error on the addition, CS0019 Operator '+' cannot be applied to operands of type Did I mis something, or is this not supported? Thanks |
Answered by
louthy
Jan 25, 2022
Replies: 2 comments
|
No, it's not possible as the |
0 replies
Answer selected by
MrYossu
|
@louthy OK, thanks. Not the sort of thing I'd do every day, but had me wondering when I saw that comment. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No, it's not possible as the
operator+declaration must be part of theOptionstruct, which means it's working with an unconstrained generic type, not anint.