Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

std.path.absolutePath should accept mutable pathnames. #2537

Merged
merged 1 commit into from Sep 20, 2014

Conversation

quickfur
Copy link
Member

@safe pure
{
if (path.empty) return null;
if (isAbsolute(path)) return path;
immutable baseVar = base;
const baseVar = base;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To fix compile error when you can't convert const to immutable. This should be harmless since immutability is not required here (we're just constructing a new path with buildPath, so it should be fine as long as it's const).

@ghost
Copy link

ghost commented Sep 20, 2014

LGTM.

@mihails-strasuns
Copy link

Auto-merge toggled on

mihails-strasuns pushed a commit that referenced this pull request Sep 20, 2014
std.path.absolutePath should accept mutable pathnames.
@mihails-strasuns mihails-strasuns merged commit 875f2fe into dlang:master Sep 20, 2014
@9rnsr
Copy link
Contributor

9rnsr commented Sep 20, 2014

@quickfur Essentially this PR should cause errors, but it was accidentally hidden by the recent git-head regression 13498. We need to revert this change to fix compiler bug. Very sorry.

@mihails-strasuns
Copy link

Hm, why it can't be implicitly cast? buildPath is not inout?

9rnsr added a commit to 9rnsr/phobos that referenced this pull request Sep 20, 2014
This reverts commit 875f2fe, reversing
changes made to f5c7e97.

The changed absolutePath code essentially cannot work because the buildPath() result is not implicitly convertible to inout(char)[], but it was accidentally accepted by the regression 13498.
@9rnsr
Copy link
Contributor

9rnsr commented Sep 20, 2014

Currently buildPath returns immutable(C)[] (C is a character type).

9rnsr added a commit to 9rnsr/phobos that referenced this pull request Sep 20, 2014
This reverts commit 875f2fe, reversing
changes made to f5c7e97.

The changed absolutePath code essentially cannot work because the buildPath() result is not implicitly convertible to inout(char)[], but it was accidentally accepted by the regression 13498.
quickfur pushed a commit that referenced this pull request Sep 20, 2014
Revert pull request #2537 to fix git-head regression issue 13498
@quickfur quickfur deleted the issue12083 branch October 20, 2014 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants