Skip to content

[CSApply] Perform a regular coerceToType when adjusting types for @preconcurrency. #70538

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
Dec 19, 2023

Conversation

hborla
Copy link
Member

@hborla hborla commented Dec 19, 2023

In a case like this:

class Request {
  @preconcurrency let identifier: (any Sendable)? = nil
}

func test(request: Request) {
  let _ = request.identifier
}

CSApply ends up in adjustTypeForDeclReference attempting to coerce any Sendable to Any. A regular coerceToType can handle this adjustment, so do that instead of asserting / silently failing.

@hborla hborla requested a review from xedin as a code owner December 19, 2023 15:39
@hborla hborla force-pushed the sendable-adjustment branch from d086d8d to e3655f5 Compare December 19, 2023 16:15
@hborla
Copy link
Member Author

hborla commented Dec 19, 2023

@swift-ci please smoke test

Copy link
Contributor

@xedin xedin left a comment

Choose a reason for hiding this comment

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

LGTM!

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.

2 participants