Bug 18565 – std.regex Captures opAssign returns void since v2.079.0

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-03-06T21:27:22Z
Last change time
2018-03-13T02:31:12Z
Assigned to
No Owner
Creator
Jan Jurzitza

Comments

Comment #0 by d.bugs — 2018-03-06T21:27:22Z
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 ---
Comment #1 by github-bugzilla — 2018-03-13T02:31:08Z
Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/0b9ca7107c49cd995e3de8886a884b34dcba435a Fix Issue 18565 - std.regex Captures opAssign returns void https://github.com/dlang/phobos/commit/f1d69eb64eab38b815d176db8e5c8b37187697e9 Merge pull request #6263 from WebFreak001/stable Fix Issue 18565 - std.regex Captures opAssign returns void merged-on-behalf-of: Sebastian Wilzbach <[email protected]>