Skip to content

Add and use AbstractFunctionDecl::getTypecheckedBody #33806

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 4 commits into from
Sep 11, 2020

Conversation

hamishknight
Copy link
Contributor

Refactor TypeCheckFunctionBodyRequest to return the type-checked body, and remove typeCheckAbstractFunctionBody in favor of a method on AbstractFunctionDecl. In addition, start returning an ErrorExpr body instead of a partially type-checked body if type-checking fails.

Then, start using getTypecheckedBody in SILGen to allow lazy type-checking when emitting function definitions.

A bunch of callers were accidentally misusing it.
Refactor TypeCheckFunctionBodyRequest to return
the type-checked body, and remove
`typeCheckAbstractFunctionBody` in favor of
a method on AbstractFunctionDecl. In addition,
start returning an ErrorExpr body instead of
a partially type-checked body if type-checking
fails.
We no longer run error checking for already
type-checked synthesized functions, so add a
couple of `setThrows` calls where they were
previously missing.
Use `getTypecheckedBody` to allow lazy
type-checking when emitting function definitions.
@hamishknight
Copy link
Contributor Author

@swift-ci please test

@hamishknight
Copy link
Contributor Author

@swift-ci please test source compatibility

@swiftlang swiftlang deleted a comment from swift-ci Sep 4, 2020
@swiftlang swiftlang deleted a comment from swift-ci Sep 4, 2020
@swiftlang swiftlang deleted a comment from swift-ci Sep 5, 2020
@swiftlang swiftlang deleted a comment from swift-ci Sep 5, 2020
@hamishknight
Copy link
Contributor Author

swiftlang/llvm-project#1753

@swift-ci please test

hamishknight added a commit to swiftlang/llvm-project that referenced this pull request Sep 11, 2020
@hamishknight hamishknight merged commit efdc358 into swiftlang:master Sep 11, 2020
hamishknight added a commit to swiftlang/llvm-project that referenced this pull request Sep 11, 2020
@hamishknight hamishknight deleted the typed-def branch September 11, 2020 15:56
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