Skip to content

[ConstraintSystem] Skip sendability check for static members #71889

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 27, 2024

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Feb 26, 2024

Such members only capture base metatatypes which are themselves always sendable.

@xedin xedin requested a review from angela-laar February 26, 2024 18:29
@xedin xedin requested review from ktoso and hborla as code owners February 26, 2024 18:29
@xedin
Copy link
Contributor Author

xedin commented Feb 26, 2024

@swift-ci please test

Such members only capture base metatatypes which are themselves
always sendable.
@xedin xedin force-pushed the static-members-are-always-sendable branch from 25dfce4 to 7c0bb41 Compare February 26, 2024 19:52
@xedin
Copy link
Contributor Author

xedin commented Feb 26, 2024

@swift-ci please test

if (isPartialApplication(locator) && baseOpenedTy->isSendableType()) {
if (isPartialApplication(locator) &&
(resolvedBaseTy->is<AnyMetatypeType>() ||
baseOpenedTy->isSendableType())) {
Copy link
Member

@hborla hborla Feb 26, 2024

Choose a reason for hiding this comment

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

Why does isSendableType() return false for AnyMetatypeType? That seems like a problem

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not that, in this example Array.init has unbound generic parameters so if we were to use isSendableType on that it would crash.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And baseOpenedTy is an instance type...

@xedin xedin merged commit f13904b into swiftlang:main Feb 27, 2024
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