Skip to content

Conversation

slavapestov
Copy link
Contributor

@slavapestov slavapestov commented Sep 12, 2025

We now allow the dummy identifier to be a qualified reference, so
that we can reconstruct generic parameter lists from multiple levels:

@_opaqueReturnTypeOf(...) __<OuterArgs...>.__<InnerArgs...>

This fixes an ambiguity with parameter packs, where flattening the
packs from multiple levels of nested types no longer produced an
unambiguous result.

To maintain backward compatibility, we still accept the old "flat"
form when no parameter packs are present.

…meter packs

We now allow the dummy identifier to be a qualified reference, so
that we can reconstruct generic parameter lists from multiple levels:

    @_opaqueReturnTypeOf(...) __.<OuterArgs...>.__<InnerArgs...>

This fixes an ambiguity with parameter packs, where flattening the
packs from multiple levels of nested types no longer produced an
unambiguous result.

To maintain backward compatibility, we still accept the old "flat"
form when no parameter packs are present.
…e involved

This is the ASTPrinter change to go with the Sema change.
We now print @_opaqueReturnTypeOf using the new nested
syntax when parameter packs are involved.

Fixes rdar://problem/151171381.
@slavapestov slavapestov marked this pull request as ready for review September 12, 2025 19:44
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

@slavapestov slavapestov merged commit 6bf5213 into swiftlang:main Sep 13, 2025
3 of 5 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.

Variadic-generic opaque return types produce malformed module interfaces

2 participants