Skip to content

[SwiftExtract] Construct .existential for 'any P' types - #901

Merged
ktoso merged 1 commit into
swiftlang:mainfrom
kateinoigakukun:pr-6cffee35ddcd5b8c28f5c0d7151358c155aa35f6
Aug 24, 2026
Merged

[SwiftExtract] Construct .existential for 'any P' types#901
ktoso merged 1 commit into
swiftlang:mainfrom
kateinoigakukun:pr-6cffee35ddcd5b8c28f5c0d7151358c155aa35f6

Conversation

@kateinoigakukun

Copy link
Copy Markdown
Member

The someOrAnyType translation had identical branches: both 'some P' and 'any P' produced SwiftType.opaque, so .existential was never constructed and 'any P' rendered as 'some P'. Construct .existential for the 'any' spelling. JExtractSwiftLib already handles .opaque and .existential in shared case arms, so its behavior is unchanged.

@kateinoigakukun
kateinoigakukun requested a review from ktoso as a code owner August 21, 2026 13:30
self = .opaque(try SwiftType(someOrAntType.constraint, lookupContext: lookupContext))
} else {
self = .opaque(try SwiftType(someOrAntType.constraint, lookupContext: lookupContext))
self = .existential(try SwiftType(someOrAntType.constraint, lookupContext: lookupContext))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice catch!

The someOrAnyType translation had identical branches: both 'some P'
and 'any P' produced SwiftType.opaque, so .existential was never
constructed and 'any P' rendered as 'some P'. Construct .existential
for the 'any' spelling. JExtractSwiftLib already handles .opaque and
.existential in shared case arms, so its behavior is unchanged.
@kateinoigakukun
kateinoigakukun force-pushed the pr-6cffee35ddcd5b8c28f5c0d7151358c155aa35f6 branch from 99e080b to d9a8771 Compare August 24, 2026 05:14
@ktoso
ktoso merged commit 8a784ec into swiftlang:main Aug 24, 2026
42 checks passed
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.

2 participants