Skip to content

[cxx-interop] Fix crash when specializing a templated SubscriptDecl#89276

Draft
j-hui wants to merge 1 commit into
swiftlang:mainfrom
j-hui:templated-operator-crash
Draft

[cxx-interop] Fix crash when specializing a templated SubscriptDecl#89276
j-hui wants to merge 1 commit into
swiftlang:mainfrom
j-hui:templated-operator-crash

Conversation

@j-hui
Copy link
Copy Markdown
Contributor

@j-hui j-hui commented May 20, 2026

rewriteIntegerTypes unwrapped the outer (Self) -> ... curry layer for any instance member, constructor, or static decl. SubscriptDecl interface types are not curried this way (they are already (Args) -> Element), so the strip overshot into the bare element type and the subsequent getParams() dereferenced garbage.

Gate the unwrap on hasImplicitSelfDecl(), which is the precise condition for having an outer Self curry layer.

rdar://177482177

rewriteIntegerTypes unwrapped the outer (Self) -> ... curry layer for
any instance member, constructor, or static decl. SubscriptDecl
interface types are not curried this way (they are already
(Args) -> Element), so the strip overshot into the bare element type
and the subsequent getParams() dereferenced garbage.

Gate the unwrap on hasImplicitSelfDecl(), which is the precise
condition for having an outer Self curry layer.

rdar://177482177
@j-hui
Copy link
Copy Markdown
Contributor Author

j-hui commented May 20, 2026

@swift-ci please smoke test

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.

1 participant