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

Update wording of uninitialized value error to be grammatically correct #14292

Merged
merged 1 commit into from Jan 26, 2022

Conversation

Xavientois
Copy link
Contributor

@Xavientois Xavientois commented Jan 18, 2022

Update wording of uninitialized value error to be grammatically correct.

Instead of "May only use initialized value as arguments." it now says "Only initialized values may be used as arguments."

In theory, this should improve readability of error messages such as:

[error] 238 |  final val VoidRef = PrimRef(NoType)
[error]     |                              ^^^^^^
[error]     |Cannot prove that the value is fully-initialized. May only use initialized value as arguments.

Signed the CLA - @Xavientois

Review by @liufengyun

@som-snytt
Copy link
Contributor

While you are in the neighborhood, it is ungrammatical to hyphenate fully-initialized.

Cannot prove that the value is fully initialized. Only initialized values can be used as arguments.

Here, I also took the liberty of upgrading "may" to "can". "May" implies mere permission, and also means "maybe", as in, "only initialized values might [turn out to] be used as arguments."

I wonder if I can find the "fully operational death star" meme.

@Xavientois
Copy link
Contributor Author

Here, I also took the liberty of upgrading "may" to "can". "May" implies mere permission, and also means "maybe", as in, "only initialized values might [turn out to] be used as arguments."

I disagree with this interpretation. The word "may" in this context is common to denote permission specifically rather than possibility.

Nothing wrong with using "can" though, so I'm not against it. I do personally prefer "may" for how it sounds, but both work fine imo.

@Xavientois
Copy link
Contributor Author

While you are in the neighborhood, it is ungrammatical to hyphenate fully-initialized.

I see what you mean. I would be open to changing that in a separate PR, but I would want to check with @liufengyun about that change. In this context, I believe the term might be hyphenated due to it referring specifically to the value being Hot as defined here as opposed to a less specific definition of "fully initialized" .

@som-snytt
Copy link
Contributor

som-snytt commented Jan 18, 2022

I do personally prefer "may"

By all means, stick with your gut feeling. "May" is fine. Also fine weather in May.

It's interesting that you understand hyphenation to have additional semantics. Obviously "American Swiss" is the cheese and "Swiss-American" is the immigrant or holder of dual passports.

The advantage of changing it now is just, so long as you're updating the check files for tests.

@som-snytt
Copy link
Contributor

LGTM when there are fewer failures, I hope they agree.

FYI, I think they also accept push -f after squashing commits. That was desirable on Scala 2.

@liufengyun
Copy link
Contributor

While you are in the neighborhood, it is ungrammatical to hyphenate fully-initialized.

I think it's fine to change it to fully initialized to be more friendly.

@Xavientois Xavientois force-pushed the initialized-value-error-grammar branch 2 times, most recently from 649c142 to 8d4ff69 Compare January 25, 2022 16:22
- Instead of "May only use initialized value as arguments." it now says "Only initialized values may be used as arguments."

Review by @liufengyun
@Xavientois Xavientois force-pushed the initialized-value-error-grammar branch from 6725cf3 to 726f0a4 Compare January 25, 2022 23:14
Copy link
Contributor

@liufengyun liufengyun left a comment

Choose a reason for hiding this comment

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

LGTM

@bishabosha bishabosha merged commit 2f16da6 into scala:master Jan 26, 2022
@Xavientois Xavientois deleted the initialized-value-error-grammar branch February 2, 2022 01:51
Xavientois added a commit to Xavientois/dotty that referenced this pull request Feb 2, 2022
…zed"

- Remove hyphen from error message (as mentioned [here](scala#14292 (comment)))

Signed the CLA - @Xavientois

Review by @liufengyun
Xavientois added a commit to Xavientois/dotty that referenced this pull request Feb 2, 2022
…zed"

- Remove hyphen from error message (as mentioned [here](scala#14292 (comment)))

Signed the CLA - @Xavientois

Review by @liufengyun
olsdavis pushed a commit to olsdavis/dotty that referenced this pull request Apr 4, 2022
…zed"

- Remove hyphen from error message (as mentioned [here](scala#14292 (comment)))

Signed the CLA - @Xavientois

Review by @liufengyun
@Kordyjan Kordyjan added this to the 3.1.3 milestone Aug 2, 2023
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.

None yet

5 participants