Skip to content

Use explicit class name in all Self.[un]wrap{In}{Out}bound{In}{Out} calls#3463

Merged
aryan-25 merged 3 commits intoapple:mainfrom
aryan-25:replace-Self
Dec 15, 2025
Merged

Use explicit class name in all Self.[un]wrap{In}{Out}bound{In}{Out} calls#3463
aryan-25 merged 3 commits intoapple:mainfrom
aryan-25:replace-Self

Conversation

@aryan-25
Copy link
Copy Markdown
Contributor

Motivation:

Swift does not currently generic specialize static methods on final classes that have no parent classes when the method is implemented in a protocol. This means that calling such methods through Self will not involve a generic specialization, whereas using the explicit type name will.

This pattern manifests in the [un]wrap{In}{Out}bound{In}{Out} static methods defined in the ChannelInboundHandler and ChannelOutboundHandler protocols and their use from all channel handler classes. As such, we should replace the Self part in all Self.[un]wrap{In}{Out}bound{In}{Out} calls with the explicit class name.

Modifications:

Replaced all Self.[un]wrap{In}{Out}bound{In}{Out} calls to use the explicit class name.

Result:

Eliminates unnecessary overhead.

@aryan-25 aryan-25 added the semver/none No version bump required. label Dec 15, 2025
@aryan-25 aryan-25 merged commit a1605a3 into apple:main Dec 15, 2025
53 of 54 checks passed
@aryan-25 aryan-25 deleted the replace-Self branch December 15, 2025 17:36
@simonjbeaumont simonjbeaumont added 🔨 semver/patch No public API change. and removed semver/none No version bump required. labels Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 semver/patch No public API change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants