Bug 20301 – std.regex.regex doesn't accept a const/immutable array of patterns
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-10-15T09:53:47Z
Last change time
2019-10-19T06:04:40Z
Keywords
pull
Assigned to
No Owner
Creator
ZombineDev
Comments
Comment #0 by petar.p.kirov — 2019-10-15T09:53:47Z
void main()
{
import std.regex;
const arr1 = ["a", "b"];
auto re1 = regex(arr1);
immutable arr2 = ["a", "b"];
auto re2 = regex(arr2);
}
Fails to compile with:
/dlang/dmd-nightly/linux/bin64/../../src/phobos/std/regex/package.d(385): Error: cannot modify const expression pat
/dlang/dmd-nightly/linux/bin64/../../src/phobos/std/regex/package.d(388): Error: cannot modify const expression pat
...
Fix incoming.
Comment #1 by dlang-bot — 2019-10-16T11:41:14Z
@ZombineDev created dlang/phobos pull request #7231 "Fix issues 20301 and 20302" fixing this issue:
- Fix Issue 20301 - Support const array of patterns in std.regex.regex
https://github.com/dlang/phobos/pull/7231
Comment #2 by dlang-bot — 2019-10-19T06:04:40Z
dlang/phobos pull request #7231 "Fix issues 20301 and 20302" was merged into stable:
- b923f740f6c5625639a85d9eb761fd7c649c893e by ZombineDev:
Fix Issue 20301 - Support const array of patterns in std.regex.regex
https://github.com/dlang/phobos/pull/7231