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

[trivial] Fix assumeUnique RUNNABLE_EXAMPLE tests #8611

Merged
merged 1 commit into from
Oct 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions std/exception.d
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ Bad:

$(RUNNABLE_EXAMPLE
----
private char[] buffer;
char[] buffer;
string letters(char first, char last)
{
if (first >= last) return null; // fine
Expand Down Expand Up @@ -873,12 +873,12 @@ The call will duplicate the array appropriately.
Note that checking for uniqueness during compilation is
possible in certain cases, especially when a function is
marked as a pure function. The following example does not
need to call assumeUnique because the compiler can infer the
need to call `assumeUnique` because the compiler can infer the
uniqueness of the array in the pure function:

$(RUNNABLE_EXAMPLE
----
string letters() pure
static string letters() pure
{
char[] result = new char['z' - 'a' + 1];
foreach (i, ref e; result)
Expand Down