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

[AST] Improve diagnostic message about constructor expression #72550

Merged
merged 1 commit into from
Mar 28, 2024

Conversation

fummicc1
Copy link
Contributor

@fummicc1 fummicc1 commented Mar 24, 2024

  • In this issue, there are 3 points to make more clear error message.

  • As for 1st point, I also agree that constructor can be replaced with initializer in terms of swift and fixed it in this PR.

  1. "constructor" instead of "initializer"
  2. Function types don't currently have members or initializers anyway
  3. A function type as the first statement in a closure without a signature is probably intended to be a signature

Use `initializer` instead of `constructor` because it is more official word to express its meaning.
@fummicc1 fummicc1 force-pushed the diagnostics-init-msg-improvement branch from 5d1d522 to 4dda7ef Compare March 27, 2024 03:33
@fummicc1 fummicc1 marked this pull request as ready for review March 27, 2024 03:35
@fummicc1 fummicc1 changed the title [Diagnostics] Improve readability about error message [AST] Improve diagnostic message about constructor expression Mar 27, 2024
@rintaro
Copy link
Member

rintaro commented Mar 28, 2024

@swift-ci Please smoke test

Copy link
Member

@rintaro rintaro left a comment

Choose a reason for hiding this comment

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

Nice, Thank you Fumiya!

@rintaro rintaro merged commit 8c67d15 into swiftlang:main Mar 28, 2024
3 checks passed
@fummicc1 fummicc1 deleted the diagnostics-init-msg-improvement branch March 29, 2024 16:04
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.

3 participants