Skip to content

[Parse/Sema] Move OptionalEvaluationExpr wrapping to PreCheckTarget #76981

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 2 commits into from
Oct 13, 2024

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Oct 11, 2024

This simplify the Parser logic and some type checker logic.

@rintaro
Copy link
Member Author

rintaro commented Oct 11, 2024

@swift-ci Please smoke test

@rintaro
Copy link
Member Author

rintaro commented Oct 11, 2024

@swift-ci please test source compatibility

This simplify the Parser diagnostics and some type checker logic.
@rintaro

This comment was marked as resolved.

@rintaro rintaro force-pushed the precheck-optional-eval-expr branch 2 times, most recently from 421e923 to 8e8e4d0 Compare October 11, 2024 21:28
@rintaro
Copy link
Member Author

rintaro commented Oct 11, 2024

@swift-ci Please smoke test

@rintaro
Copy link
Member Author

rintaro commented Oct 11, 2024

// expected-note@-2 {{found candidate with type '(Int.Type) -> Dictionary<Int, String>.SubSequence' (aka '(Int.Type) -> Slice<Dictionary<Int, String>>')}}
// expected-note@-3 {{to match this opening '['}}
// expected-error@-1 {{cannot convert value of type 'Int.Type' to expected argument type 'Int'}}
// expected-note@-2 {{to match this opening '['}}
Copy link
Member Author

Choose a reason for hiding this comment

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

This is because previously the parser didn't wrap the expression with OptionalEvaluationExpr if it has an parse error.

Copy link
Contributor

@hamishknight hamishknight left a comment

Choose a reason for hiding this comment

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

Great cleanup!

@rintaro rintaro force-pushed the precheck-optional-eval-expr branch from d650917 to ffeaa71 Compare October 13, 2024 00:24
@rintaro
Copy link
Member Author

rintaro commented Oct 13, 2024

@swift-ci Please smoke test

@rintaro
Copy link
Member Author

rintaro commented Oct 13, 2024

@swift-ci please test source compatibility

@rintaro rintaro merged commit 231e333 into swiftlang:main Oct 13, 2024
5 checks passed
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.

2 participants