Skip to content

AST: make isNotAfter a strict weak ordering #27805

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

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/AST/ASTScopeCreation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ class ScopeCreator final {
#endif
ASTScopeAssert(startOrder * endOrder != -1,
"Start order contradicts end order");
return startOrder + endOrder < 1;
return startOrder <= 0 && endOrder <= 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

After looking at this again, I'm suspecting that the right answer is an assertion that endOrder != 0 and a simple test for endOrder < 0. But I haven't tried it yet. I'll run some tests this weekend. (I would also keep the existing assertion.)

Copy link
Contributor

Choose a reason for hiding this comment

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

@compnerd I've got a slightly different solution that I like better, or I will if it passes the tests. See #28039
Once it lands, I'm hopeful it will solve this problem Thanks for your patience!

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for fixing this, I'll test it out locally.

Copy link
Contributor

Choose a reason for hiding this comment

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

Happy to do so. Thank you for your patience.

}

static bool isVarDeclInPatternBindingDecl(ASTNode n1, ASTNode n2) {
Expand Down