-
Notifications
You must be signed in to change notification settings - Fork 10.5k
TypeCheckType: Fix some bugs in the any
syntax checker
#72659
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
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
5a2316c
[NFC] AST: Define `TypeRepr::isParenType()`
AnthonyLatsis 50de5a5
[NFC] ExistentialTypeSyntaxChecker: Document, rename and make `existe…
AnthonyLatsis 1b6efc1
[NFC] Reorganize and extend `any` syntax enforcement tests
AnthonyLatsis 44e5286
ExistentialTypeSyntaxChecker: Look through `any` and `some`
AnthonyLatsis b90b564
ExistentialTypeSyntaxChecker: Look through inverses
AnthonyLatsis 8955625
ExistentialTypeSyntaxChecker: Fix `any` fix-it for higher-order metat…
AnthonyLatsis 89f6d27
ExistentialTypeSyntaxChecker: Fix `any` fix-it for compositions
AnthonyLatsis 704244b
ExistentialTypeSyntaxChecker: Fix `any` fix-it for inverse constraints
AnthonyLatsis 6e5d6f1
ExistentialTypeSyntaxChecker: Fix `any` fix-it for IUO
AnthonyLatsis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,9 +103,9 @@ struct DoesNotConform : Up { | |
// Circular protocols | ||
|
||
protocol CircleMiddle : CircleStart { func circle_middle() } | ||
// expected-note@-1 2 {{protocol 'CircleMiddle' declared here}} | ||
protocol CircleStart : CircleEnd { func circle_start() } // expected-error 2 {{protocol 'CircleStart' refines itself}} | ||
protocol CircleEnd : CircleMiddle { func circle_end()} // expected-note 2 {{protocol 'CircleEnd' declared here}} | ||
// expected-note@-1 3 {{protocol 'CircleMiddle' declared here}} | ||
protocol CircleStart : CircleEnd { func circle_start() } // expected-error 3 {{protocol 'CircleStart' refines itself}} | ||
protocol CircleEnd : CircleMiddle { func circle_end()} // expected-note 3 {{protocol 'CircleEnd' declared here}} | ||
Comment on lines
-106
to
+108
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is unfortunate although definitely not a |
||
|
||
protocol CircleEntry : CircleTrivial { } | ||
protocol CircleTrivial : CircleTrivial { } // expected-error {{protocol 'CircleTrivial' refines itself}} | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might be able to just pass down the outermost location instead of "backtracking" here, but it's fine the way it is
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for sharing your thoughts on this, Slava.
Is this roughly what you meant (passing
tildeLoc
down such that if valid here, then the~
necessarily pertains to the given identifier type)?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m going to try to get this into the release as is before it’s too late, but I’m still very much willing to discuss this alternative.