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
Make in
a first-class storage class, not a const [scope]
alias
#11474
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Parameters marked as `in` will now be properly displayed | ||
|
||
In earlier releases, using `in` on parameters would be lowered too early, | ||
leading to confusing display: error messages would show the parameter | ||
as `const` (or `scope const` if `-preview=in` was used), | ||
and so would header generations or stack traces. | ||
The header generation was problematic, as a header generated with `-preview=in` | ||
would be different from one generated without. | ||
From this release, `in` will now display correctly in every message. | ||
As this requires an update to the mangling, some older debuggers or tools | ||
might not be able to properly demangle functions that uses `in` parameters. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
PERMUTE_ARGS: -preview=in | ||
TEST_OUTPUT: | ||
--- | ||
fail_compilation/diagin.d(18): Error: function `diagin.foo(in string)` is not callable using argument types `()` | ||
fail_compilation/diagin.d(18): missing argument for parameter #1: `in string` | ||
fail_compilation/diagin.d(19): Error: function `diagin.foo1(in ref string)` is not callable using argument types `()` | ||
fail_compilation/diagin.d(19): missing argument for parameter #1: `in ref string` | ||
fail_compilation/diagin.d(20): Error: template `diagin.foo2` cannot deduce function from argument types `!()(int)`, candidates are: | ||
fail_compilation/diagin.d(27): `foo2(T)(in T v, string)` | ||
fail_compilation/diagin.d(22): Error: template `diagin.foo3` cannot deduce function from argument types `!()(bool[])`, candidates are: | ||
fail_compilation/diagin.d(28): `foo3(T)(in ref T v, string)` | ||
--- | ||
*/ | ||
|
||
void main () | ||
{ | ||
foo(); | ||
foo1(); | ||
foo2(42); | ||
bool[] lvalue; | ||
foo3(lvalue); | ||
} | ||
|
||
void foo(in string) {} | ||
void foo1(in ref string) {} | ||
void foo2(T)(in T v, string) {} | ||
void foo3(T)(ref in T v, string) {} | ||
|
||
// Ensure that `in` has a unique mangling | ||
static assert(foo.mangleof == `_D6diagin3fooFIxAyaZv`); | ||
static assert(foo1.mangleof == `_D6diagin4foo1FIKxAyaZv`); | ||
static assert(foo2!int.mangleof == `_D6diagin__T4foo2TiZQiFNaNbNiNfIxiAyaZv`); | ||
static assert(foo3!char.mangleof == `_D6diagin__T4foo3TaZQiFNaNbNiNfIKxaAyaZv`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am wondering why this change does not seem to break tests.
Where was Tident used? in templates?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It isn't used (dlang/druntime#2847 (comment))