[Issue 18565] New: std.regex Captures opAssign returns void since v2.079.0
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Mar 6 21:27:22 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=18565
Issue ID: 18565
Summary: std.regex Captures opAssign returns void since
v2.079.0
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: regression
Priority: P1
Component: phobos
Assignee: nobody at puremagic.com
Reporter: d.bugs at webfreak.org
Before commit 59520969ef73eaf0691972ee00b389e5bbc4c8fb this code used to work:
---
import std.regex;
void main()
{
string str;
Captures!string match;
if (cast(bool)(match = str.matchFirst("a"))
|| cast(bool)(match = str.matchFirst("b"))) {}
}
---
and it performed the expected operations. However now the compilation fails
with:
---
a.d(7): Error: cannot cast expression match.opAssign(matchFirst(str, "a")) of
type void to bool
a.d(8): Error: cannot cast expression match.opAssign(matchFirst(str, "b")) of
type void to bool
---
--
More information about the Digitalmars-d-bugs
mailing list