-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Stop allowing impl
redeclarations to differ syntactically in where
clause
#4850
Conversation
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.
Generally LG, just some minor style nits.
toolchain/check/handle_impl.cpp
Outdated
last_param_iter); | ||
} while (where_operands_to_skip > 0); | ||
} | ||
Parse::NodeId last_param_node_id(end_of_decl_node_id.index - 1); |
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.
Would it make sense to keep treating NodeId::index as opaque, keeping the PostorderIterator
use? As a reminder, #4762 (comment)
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.
Switched back to using PostorderIterator
.
toolchain/check/testdata/impl/no_prelude/impl_where_redecl.carbon
Outdated
Show resolved
Hide resolved
Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
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 holding off on merging since it looks like there are some regressions after I synced it to head.
I fixed the bad merge, tests now pass. |
Based on the lastest thinking on #4672 , require a full syntactic match for impl redeclaration, instead of excluding the
where
restriction. This means no updates to the impl witness on redeclaration, and no diagnostics that those updates are consistent.Not included in this PR, but will need to be done in the future:
check/impl.cpp
that are now always called together.Also add some test coverage of
where
parsing I developed in PR I've now abandoned because of this new simplification of the impl redeclaration semantics.