{{ message }}
Repository navigation
Restore method recognition after C++ constructor bodies - #3395
Open
jnohclee-rgb wants to merge 1 commit into
Open
jnohclee-rgb wants to merge 1 commit into
jnohclee-rgb wants to merge 1 commit into
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

After an unrecognized C++ constructor body, the generic statement state can remain active across its closing brace. The following member declaration is then highlighted as ordinary names:
struct point { point() {} int dim() const { return 1; } };losesdim'sName.Functionclassification.Return the C++ statement state to its parent at a closing brace. The shared C rules are unchanged. Add a narrow inherited Pike case-label guard so recovered function bodies preserve existing case-colon punctuation. Updated C++, CUDA, MQL and Pike goldens recover method/function names; two local direct-initialization variables (
returnStranddimBlock) correctly become ordinary names.Related to #2547, specifically its remaining constructor/member case. The template-return case belongs to the separate open #3361 and is not fixed here.
Validation: 15 focused tests pass (seven fail on the original modules; eight preservation cases pass). Full
tox -e py: 5,345 passed, 16 skipped.tox -e checkpasses. Existing environments were reused with installation disabled and this worktree explicitly onPYTHONPATH. Independent review accepted the source and golden changes, reran all 15 focused cases, and passed four additional declaration/context cases.AI assistance: Codex assisted with implementation, testing and review. No compiler validation or optional regexlint/version matrix was run.
Dharma — leave the code kinder than we found it.