Repository navigation
fix(swift): read inheritance from the type declaration itself - #3220
Open
remote-controlled-man wants to merge 2 commits into
Open
remote-controlled-man wants to merge 2 commits into
remote-controlled-man wants to merge 2 commits into
Conversation
This branch has not been deployed
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 #3213.
A Swift type with no inheritance clause could borrow a nested declaration's clause from the bounded source-header window.
struct Screen { class Helper: Base {}; var state: State }therefore acquired a reference toBase.State, placingScreenin the wrong impact results.Read only the current declaration's inheritance clause, after blanking strings and comments. The existing header window, generic arguments, multiline bases and
wherehandling remain in place.Regression tests use
CodeGraph.init()with real files and SQLite. They reject the false reference and impact entries, preserve inherited nested types, and cover attribute comments plus a multiline attribute string with a continuation and literal/*.Validation on macOS, Node 24.21.0:
CODEGRAPH_TELEMETRY=0 npm run build: passed.CODEGRAPH_TELEMETRY=0 npm test -- --maxWorkers=4, withTMPDIRset to its canonical path: 867 files passed, 19 skipped; 10,533 tests passed, 2 expected failures, 431 skipped, 0 failures.An initial full run hit 30 installer path assertions with macOS's
/vartemporary-directory alias; using the same directory's real/private/varpath passed. The optional Rust kernel was not built, so its gated tests were skipped. Linux and Windows were not run.AI-assisted implementation with Codex.