Skip to content

Unified: Introduce CallableEx and ParameterEx - #22690

Draft
hvitved wants to merge 1 commit into
github:mainfrom
hvitved:unified/callable-ex
Draft

hvitved wants to merge 1 commit into
github:mainfrom
hvitved:unified/callable-ex

Conversation

@hvitved

@hvitved hvitved commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

This PR introduces CallableEx and ParameterEx in order to have shared logic for default/inherited constructors and implicit receiver parameters. I am working on a follow-up PR that makes use of these in type inference.

Comment thread unified/ql/lib/codeql/unified/internal/CallableEx.qll Fixed
Comment thread unified/ql/lib/codeql/unified/internal/CallableEx.qll Fixed
Comment thread unified/ql/lib/codeql/unified/internal/CallableExPlugin.qll Fixed
@hvitved
hvitved force-pushed the unified/callable-ex branch from c4c1d44 to af8addb Compare September 29, 2026 14:09
Comment thread unified/ql/lib/codeql/unified/internal/CallableEx.qll Fixed
private import codeql.unified.internal.CallableExPluginSwift
}

/** Extension point for language-specific inputs to `CallableEx.qll`. */
@hvitved
hvitved force-pushed the unified/callable-ex branch 2 times, most recently from 9a3ae2b to 00344d0 Compare September 30, 2026 12:25
@hvitved hvitved added the no-change-note-required This PR does not need a change note label Sep 30, 2026
@hvitved
hvitved requested a balanced review from Copilot September 30, 2026 12:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Constructor synthesis mishandles protocol conformances, convenience initializers, and static struct properties.

Review effort: Balanced
Findings: 1 High severity · 2 Medium severity · 1 Low severity

Open (4)
What changed in this PR

Introduces unified abstractions for source and synthesized callables, parameters, default constructors, and inherited constructors.

Changes:

  • Adds CallableEx and ParameterEx abstractions.
  • Adds Swift-specific constructor synthesis rules.
  • Adds Swift constructor fixtures and query expectations.
File Description
CallableEx.qll Implements extended callable and parameter modeling.
CallableExPlugin.qll Defines language-specific extension points.
CallableExPluginSwift.qll Supplies Swift constructor synthesis rules.
constructors.swift Adds Swift constructor test fixtures.
test.ql Queries synthesized constructors and parameters.
test.expected Records generated query expectations.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread unified/ql/lib/codeql/unified/internal/CallableEx.qll Outdated
Comment thread unified/ql/lib/codeql/unified/internal/CallableEx.qll
Comment thread unified/ql/lib/codeql/unified/internal/CallableExPluginSwift.qll
Comment thread unified/ql/lib/codeql/unified/internal/CallableExPluginSwift.qll Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment thread unified/ql/lib/codeql/unified/internal/CallableEx.qll Outdated
Comment thread unified/ql/lib/codeql/unified/internal/CallableEx.qll
Comment thread unified/ql/lib/codeql/unified/internal/CallableExPlugin.qll Outdated
@hvitved
hvitved force-pushed the unified/callable-ex branch 2 times, most recently from 389fd3a to 4b6b368 Compare September 30, 2026 13:15
@hvitved
hvitved requested a balanced review from Copilot September 30, 2026 13:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Constructor synthesis mishandles unresolved superclasses and shadowed convenience initializers, with one inherited-parameter path left untested.

Review effort: Balanced
Findings: 2 Medium severity · 1 Low severity

Open (3)
Resolved since last review (3)

Comment thread unified/ql/lib/codeql/unified/internal/CallableEx.qll
Comment thread unified/ql/lib/codeql/unified/internal/CallableEx.qll
Comment thread unified/ql/test/library-tests/constructors/test.ql Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Constructor synthesis currently includes inaccessible and shadowed inherited initializers.

Review effort: Balanced
Findings: 2 Medium severity

Open (2)
Resolved since last review (3)

Comment thread unified/ql/lib/codeql/unified/internal/CallableEx.qll
Comment thread unified/ql/lib/codeql/unified/internal/CallableExPluginSwift.qll

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

no-change-note-required This PR does not need a change note Unified

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants