fix(extraction): strip template args from out-of-line C++ method qualifiers (#1286)#1287
Open
Dshuishui wants to merge 1 commit into
Open
fix(extraction): strip template args from out-of-line C++ method qualifiers (#1286)#1287Dshuishui wants to merge 1 commit into
Dshuishui wants to merge 1 commit into
Conversation
…ifiers (colbymchenry#1286) An out-of-line template method definition (`template<typename T> T Box<T>::get()`) recorded its class qualifier as the full instantiation `Box<T>`, so the method's qualified_name came out as `Box<T>::get`. That never name-matched the class node indexed as the bare `Box` (the same failure mode colbymchenry#1043 fixed for templated base classes), and with long / multi-line template parameters the qualified_name could exceed the 255-byte filename limit — a consumer deriving a filename from it hits "File name too long". Apply the existing stripCppTemplateArgs helper to the receiver in extractCppReceiverType, before splitting on `::` (which also tolerates `::` inside template args). Inline method bodies were already unaffected.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Fixes #1286.
Problem
stripCppTemplateArgs(added in #1043 to drop<…>from templated base-class refs soextendsresolves) isn't applied to method qualifiers. An out-of-line template method keeps the class template params inqualified_name:nameis already clean (get); only the qualifier leaks.Box::get) — the same method got a differentqualified_namedepending on where it's defined.capi_helper.hshape) push thequalified_namepast NAME_MAX (255) → consumers deriving a filename hit "File name too long".extends:name-matchercompares the qualifier before the last::, andBox<T>≠ the class nodeBox.Fix
Apply the existing
stripCppTemplateArgsto the receiver inextractCppReceiverType, before the::split (also tolerates::inside template args likeBox<std::string>::get). Reuses the #1043 helper.Tests
__tests__/extraction.test.ts: out-of-lineBox<T>::get/setnow extract asBox::get/Box::set; no node carries<in its qualified name.