std.sumtype?

Paul Backus snarwin at gmail.com
Sun Aug 29 19:57:33 UTC 2021


On Sunday, 29 August 2021 at 19:29:29 UTC, SealabJaster wrote:
> On Sunday, 29 August 2021 at 19:19:54 UTC, SealabJaster wrote:
>> ...
>
> While I'm on a tiny rant, I'd like to just mention that 
> compiler errors with SumType can be a bit obtuse.
>
> It's often annoying when you're using a generic case but due to 
> a compiler error that the SumType eats up, all you get is 
> "handler[x] is never matched" or "type X is unhandled", etc.

I agree, this is annoying. My current best solution to this is:

1. Recompile with `-verrors=spec` and redirect the compiler's 
output to a file.
2. `grep` the file for error messages whose location is in one of 
my source files.
3. Search the results of that `grep` for the actual error that 
caused things to fail.

By the way, this process works for anything that fails because of 
errors in a `__traits(compiles)` or `typeof(...)` check, not just 
`match`.


More information about the Digitalmars-d mailing list