Skip to content

fix(swift): read inheritance from the type declaration itself - #3220

Open
remote-controlled-man wants to merge 2 commits into
colbymchenry:mainfrom
remote-controlled-man:codex/prflow-c14178e178c3
Open

remote-controlled-man wants to merge 2 commits into
colbymchenry:mainfrom
remote-controlled-man:codex/prflow-c14178e178c3

Conversation

@remote-controlled-man

Copy link
Copy Markdown

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 to Base.State, placing Screen in 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 where handling 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, with TMPDIR set to its canonical path: 867 files passed, 19 skipped; 10,533 tests passed, 2 expected failures, 431 skipped, 0 failures.
  • The two focused Swift test files: 11 passed.

An initial full run hit 30 installer path assertions with macOS's /var temporary-directory alias; using the same directory's real /private/var path 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.

Copilot AI balanced review requested due to automatic review settings November 2, 2026 03:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Swift: declaredSupertypes reads a nested declaration's inheritance clause as the outer type's

2 participants