Skip to content

Conversation

hamishknight
Copy link
Contributor

matchExistentialTypes can handle existential metatypes, fix the assert to handle that.

`matchExistentialTypes` can handle existential metatypes, fix the
assert to handle that.
@hamishknight
Copy link
Contributor Author

@swift-ci please smoke test

@hamishknight hamishknight enabled auto-merge August 28, 2025 23:37
kind != ConstraintKind::NonisolatedConformsTo &&
kind != ConstraintKind::TransitivelyConformsTo) ||
second->isExistentialType());
second->isAnyExistentialType());
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we unwrap the metatype before we generate the constraint though, in the caller?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think we can since we rely on matchExistentialTypes to iteratively match each level of metatype, i.e if you have $T0 <> P.Type, we need to form an unsolved constraint with P.Type since we wouldn't want it to succeed if $T0 ends up being simply S rather than S.Type.

@hamishknight hamishknight merged commit a309fc0 into swiftlang:main Aug 29, 2025
3 checks passed
@hamishknight hamishknight deleted the tweak-assert branch August 29, 2025 08:55
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.

3 participants