[Issue 22015] sumtype Error: e2ir: cannot cast `...` of type `noreturn` to type `string`

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jun 11 01:30:42 UTC 2021


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

João Lourenço <jlourenco5691 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jlourenco5691 at gmail.com

--- Comment #1 from João Lourenço <jlourenco5691 at gmail.com> ---
A better workaround is:

```d
string unwrap(Result r) {
    return r.match!(
        (string s) => s,
        function string (int) { assert(0); },
    );
}
```

--


More information about the Digitalmars-d-bugs mailing list