Skip to content

Conversation

@kavon
Copy link
Member

@kavon kavon commented Nov 25, 2025

No description provided.

There's about to be a second version that I'd like to
test in parallel with the old version.
This is similar to SuppressedAssociatedTypes, but infers
default requirements when primary associated types of
protocols are suppressed. This defaulting for the primary
associated types happens in extensions of the protocol,
along with generic parameters, whenever a source-written
requirement states a conformance requirement for the protocol.

Thus, the current scheme for this defaulting is a simplistic,
driven by source-written requirements, rather than facts
that are inferred while building generic signatures.

Defaults are not expanded for infinitely many associated types.

Other changes include...

Sema: adjust protocol extension signature hack

With SuppressedAssociatedTypesWithDefaults,
we can have associated types that are missing
invertible conformance requirements, so we need
to try re-building the signature for the extension
of the protocol. Otherwise, we won't infer the new
default(s) for those associated types.

This previous hack was only trying to shortcut
the rebuilding if it saw Self is lacking a conformance
requirement. Now it'll check if any inverses were written
in source for that protocol.
@kavon kavon force-pushed the suppressed-assoc-types-with-defaults branch from 7a739ba to c486f40 Compare November 25, 2025 23:15
@kavon
Copy link
Member Author

kavon commented Nov 25, 2025

@swift-ci 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