Skip to content

Improved Cast Diagnostics when Literals are involved #64846

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

Merged
merged 1 commit into from
Apr 8, 2023

Conversation

Rajveer100
Copy link
Contributor

@Rajveer100 Rajveer100 commented Apr 2, 2023

Fixes #53822

Emphasised the diagnostic involving conditional downcast to coercion making it more specific adding some contrast between casting (as?) and coercing (as).

@Rajveer100
Copy link
Contributor Author

@AnthonyLatsis Request your review.

@Rajveer100 Rajveer100 force-pushed the branch-for-issue-53822 branch from 2bd2566 to 7d69a5c Compare April 2, 2023 08:16
Copy link
Collaborator

@AnthonyLatsis AnthonyLatsis left a comment

Choose a reason for hiding this comment

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

Looking good so far!

@AnthonyLatsis
Copy link
Collaborator

@swift-ci please smoke test macOS

@Rajveer100
Copy link
Contributor Author

Rajveer100 commented Apr 3, 2023

Please let me know more issues to solve!

While I keep surfing and searching, often there are issues which are not marked as 'good-first-issues' but I assume I can at least try some viable ones!

@LucianoPAlmeida
Copy link
Contributor

We have to update the test cases for this new message as well =]

@Rajveer100
Copy link
Contributor Author

Whoops! My bad!

@Rajveer100 Rajveer100 force-pushed the branch-for-issue-53822 branch from 7d69a5c to f745115 Compare April 3, 2023 17:28
@Rajveer100
Copy link
Contributor Author

@swift-ci please smoke test macOS

@LucianoPAlmeida
Copy link
Contributor

@swift-ci Please smoke test macOS platform

Copy link
Collaborator

@AnthonyLatsis AnthonyLatsis left a comment

Choose a reason for hiding this comment

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

Yes, the bot won’t trigger without write access.

@Rajveer100 Rajveer100 force-pushed the branch-for-issue-53822 branch from f745115 to c87f451 Compare April 5, 2023 10:49
@Rajveer100
Copy link
Contributor Author

Any other additions/changes that's required?

@Rajveer100 Rajveer100 force-pushed the branch-for-issue-53822 branch from c87f451 to 60a9f47 Compare April 6, 2023 18:16
@Rajveer100
Copy link
Contributor Author

@AnthonyLatsis I have made the changes...

Copy link
Collaborator

@AnthonyLatsis AnthonyLatsis left a comment

Choose a reason for hiding this comment

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

Very nice, thank you! The final word belongs to the code owners.

One last nit from me: please add a "Sema" tag to the commit message.

@Rajveer100 Rajveer100 force-pushed the branch-for-issue-53822 branch from 60a9f47 to 2c96e90 Compare April 6, 2023 18:48
@Rajveer100
Copy link
Contributor Author

Thanks! I have done that too!

@AnthonyLatsis
Copy link
Collaborator

@swift-ci please smoke test macOS

Copy link
Contributor

@xedin xedin left a comment

Choose a reason for hiding this comment

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

LGTM!

@xedin
Copy link
Contributor

xedin commented Apr 7, 2023

@swift-ci please test Linux platform

@xedin
Copy link
Contributor

xedin commented Apr 7, 2023

@swift-ci please test Windows platform

@xedin xedin merged commit c776676 into swiftlang:main Apr 8, 2023
@Rajveer100 Rajveer100 deleted the branch-for-issue-53822 branch April 8, 2023 09:57
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.

[SR-11421] Checked Cast Diagnostics Should Be More Specific When Literals Are Involved
4 participants