-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[TypeChecker] TypeChecker::isSubtypeOf
should recognize Sendable s…
#70502
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
[TypeChecker] TypeChecker::isSubtypeOf
should recognize Sendable s…
#70502
Conversation
@swift-ci please test |
@swift-ci please test source compatibility |
f4d724b
to
6b60f15
Compare
TypeChecker::isSubtypeOf
should recognize @Sendable s…TypeChecker::isSubtypeOf
should recognize Sendable s…
Generalized this to Sendable interactions in type context. |
@swift-ci please test |
@swift-ci please test source compatibility |
…ubtyping A sendable function can be a subtype of a non-@sendable function, that is currently established via a fix. `TypeChecker::isSubtypeOf` should recognize its presence and fail.
…btyping A sendable type can be a subtype of a non-Sendable type, i.e. `any X & Sendable` vs. `X` where `X` is a class. The solver adjusts `MissingSynthesizableConformance` to indicate that one of the types is missing `Sendable` and that needs to be recognized by `TypeChecker::isSubtypeOf`.
6b60f15
to
359ea14
Compare
@swift-ci please test |
@swift-ci please test source compatibility |
Source compat failure is due to |
Please test with following pull request: @swift-ci Please test source compatibility |
@swift-ci please test source compatibility |
@swift-ci please smoke test |
This approach regressed existing ternary expressions that join to `any Sendable` and one brach is inferred from the ternary type variable.
This approach regressed existing ternary expressions that join to `any Sendable` and one branch is inferred from the ternary type variable.
…ubtyping
A sendable type can be a subtype of a non-Sendable type.
That is currently established via a fix (for function types) and score change
(
SK_MissingSynthesizableConformance
for regular nominal types).TypeChecker::isSubtypeOf
should recognize its presence and fail.