Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
/ druntime Public archive

Conversation

@JinShil
Copy link
Contributor

@JinShil JinShil commented Sep 1, 2019

Followup to
#2676
dlang/phobos#7110
#2680
#2684
#2693
#2694
#2695
#2696
#2697
#2699
#2702
#2704
#2781

This one of several PRs I intend to submit, breaking up #2677 into multiple PRs.

Background

This PR is in support of dlang/dmd#10382

in as a parameter storage class is defined as scope const. However in has not yet
been properly implemented so its current implementation is equivalent to const. Properly
implementing in now will likely break code, so it is recommended to avoid using in, and
explicitly use const or scope const instead, until in is properly implemented.

The use of in as a parameter storage class is already discouraged in the documentation. See https://dlang.org/spec/function.html#parameters

{
string s;
toString((buf) { s ~= buf; });
toString((scope const buf) { s ~= buf; });
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Shouldn't the compiler be able to infer the scope const here?

@JinShil
Copy link
Contributor Author

JinShil commented Sep 2, 2019

A decision about in has finally been made: dlang/dmd#10382 (comment)

@JinShil JinShil closed this Sep 2, 2019
@JinShil JinShil deleted the tostring_in branch September 2, 2019 09:58
rainers pushed a commit to rainers/druntime that referenced this pull request Sep 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants