Skip to content
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

Diagnose unavailable closures without types #40660

Merged

Conversation

etcwilde
Copy link
Contributor

In complex situations, a type would not be assigned to an abstract
closure that was the declaration context of the declaration being
checked. This used to cause crashes because you couldn't query a closure
on whether it was an async context if it didn't have a type assigned.

This behaviour has been updated to lazily compute the function decl ext
info if the type hasn't already been assigned. This means that calling
AbstractClosureExpr::isAsyncContext is now safe, even when a type has
not yet been assigned. This was cleaned up by #40544.

@etcwilde
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - e80a837

@etcwilde
Copy link
Contributor Author

Linux test failure in Swift(linux-x86_64) :: Sanitizers/tsan/racy_async_let_fibonacci.swift. It looks unrelated, but investigating.

@etcwilde
Copy link
Contributor Author

@swift-ci please test Linux

@etcwilde
Copy link
Contributor Author

etcwilde commented Jan 4, 2022

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented Jan 4, 2022

Build failed
Swift Test Linux Platform
Git Sha - e80a837

@etcwilde
Copy link
Contributor Author

@swift-ci please test

@etcwilde etcwilde requested a review from tshortli October 7, 2022 23:27
In complex situations, a type would not be assigned to an abstract
closure that was the declaration context of the declaration being
checked. This used to cause crashes because you couldn't query a closure
on whether it was an async context if it didn't have a type assigned.

This behaviour has been updated to lazily compute the function decl ext
info if the type hasn't already been assigned. This means that calling
`AbstractClosureExpr::isAsyncContext` is now safe, even when a type has
not yet been assigned.

The request change was added in commit
c3b6160.
@etcwilde etcwilde force-pushed the ewilde/abstract-closures-are-alright-now branch from e80a837 to 44ac39a Compare January 9, 2023 17:25
@etcwilde
Copy link
Contributor Author

etcwilde commented Jan 9, 2023

@swift-ci please test

@etcwilde etcwilde merged commit 68760fc into swiftlang:main Jan 10, 2023
@etcwilde etcwilde deleted the ewilde/abstract-closures-are-alright-now branch April 2, 2023 05:53
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.

None yet

4 participants