www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21708] New: SumType.opEquals gives confusing error message

https://issues.dlang.org/show_bug.cgi?id=21708

          Issue ID: 21708
           Summary: SumType.opEquals gives confusing error message
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: snarwin+bugzilla gmail.com

Example code:

---
SumType!int x;
x == 123;
---

Error message:

---
src/sumtype.d(587,11): Error: void has no value
src/sumtype.d(587,39): Error: void has no value
---

This is confusing, because the actual error is that it is not valid to compare
a `SumType!int` with an `int`.

--
Mar 13 2021