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

Retry to fix issue 4539 - Refuse assignment to string literal #164

Merged
merged 1 commit into from
Jan 29, 2012

Conversation

9rnsr
Copy link
Contributor

@9rnsr 9rnsr commented Jun 25, 2011

@dnadlinger
Copy link
Member

See also: pull request #188.

@9rnsr
Copy link
Contributor Author

9rnsr commented Sep 5, 2011

#180 (and the improved #362) is unrelated pull request with this issue.

Current dmd treats string literal as Lvalue, but it is invalid. This patch changes string literal as Rvalue, and passing it to ref parameter will be statically rejected.

@yebblies
Copy link
Member

yebblies commented Sep 5, 2011

#188 is identical to this one. I missed this one when I created it. In the future please add a link to the pull request on the bug's bugzilla page, and add the patch keywork. I'll close #188.

Also note Don's comment on #188.

@9rnsr
Copy link
Contributor Author

9rnsr commented Dec 25, 2011

Updated patch.
Now we can receive string literals by a reference to static array type (e.g. ref const char[N]).
See test4539() in xtest46.d

@yebblies
Copy link
Member

I would love to see this in the next release. Bug reports due to this appear quite consistently.

WalterBright added a commit that referenced this pull request Jan 29, 2012
Retry to fix issue 4539 - Refuse assignment to string literal
@WalterBright WalterBright merged commit 7f33ed7 into dlang:master Jan 29, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants