-
-
Notifications
You must be signed in to change notification settings - Fork 745
Closed
Labels
Severity:RegressionIssues that are regressions/PRs that fix regressionsIssues that are regressions/PRs that fix regressions
Description
void main() {
import std.getopt;
const(string)[] s;
string[] args;
getopt(args, "-s", &s);
}
This compiles fine with DMD/Phobos v2.110.0, but doesn't compile with v2.111.0-beta.1:
/home/mkinkelin/dlang/dmd-2.111.0-beta.1/linux/bin64/../../src/phobos/std/getopt.d(620): Error: cannot modify `const` expression `*receiver`
*receiver = to!(typeof(*receiver))(value);
^
/home/mkinkelin/dlang/dmd-2.111.0-beta.1/linux/bin64/../../src/phobos/std/getopt.d(964): Error: template instance `std.getopt.handleConversion!(const(string))` error instantiating
handleConversion(option, val, &tmp, i);
^
/home/mkinkelin/dlang/dmd-2.111.0-beta.1/linux/bin64/../../src/phobos/std/getopt.d(772): instantiated from here: `handleOption!(const(string)[]*)`
bool optWasHandled = handleOption(option, receiver, args, cfg, incremental);
^
/home/mkinkelin/dlang/dmd-2.111.0-beta.1/linux/bin64/../../src/phobos/std/getopt.d(430): instantiated from here: `getoptImpl!(string, const(string)[]*)`
getoptImpl(args, cfg, rslt, excep, visitedLongOpts, visitedShortOpts, opts);
^
getopt_bug.d(6): instantiated from here: `getopt!(string, const(string)[]*)`
getopt(args, "-s", &s);
^
Introduced in #10593.
Metadata
Metadata
Assignees
Labels
Severity:RegressionIssues that are regressions/PRs that fix regressionsIssues that are regressions/PRs that fix regressions