Skip to content

Sema: Diagnose @backDeployed functions with missing bodies in swiftinterfaces #78327

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 21, 2024

Conversation

tshortli
Copy link
Contributor

A @backDeployed function printed in a .swiftinterface must have a function body so that SILGen can emit a fallback copy to call when the back deployed function is unavailable. Previously, the compiler would crash in SILGen when compiling an interface containing a back deployed function without a body.

Resolves rdar://141593108.

@tshortli tshortli requested review from nkcsgexi and artemcm December 20, 2024 19:54
@tshortli tshortli changed the title Sema: Diagnose @backDeployed functions with missing bodies in swiftinterfaces Sema: Diagnose @backDeployed functions with missing bodies in swiftinterfaces Dec 20, 2024
Copy link
Contributor

@nkcsgexi nkcsgexi left a comment

Choose a reason for hiding this comment

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

Thank you for diagnosing this early!

…terfaces.

A `@backDeployed` function printed in a `.swiftinterface` must have a function
body so that SILGen can emit a fallback copy to call when the back deployed
function is unavailable. Previously, the compiler would crash in SILGen when
compiling an interface containing a back deployed function without a body.

Resolves rdar://141593108.
@tshortli tshortli force-pushed the back-deployed-without-body branch from 3951856 to ebda3e2 Compare December 20, 2024 20:02
@tshortli
Copy link
Contributor Author

@swift-ci please test

@tshortli tshortli enabled auto-merge December 20, 2024 20:02
@tshortli tshortli merged commit bfd7752 into swiftlang:main Dec 21, 2024
4 of 5 checks passed
@tshortli tshortli deleted the back-deployed-without-body branch December 21, 2024 02:49
@DougGregor
Copy link
Member

I hit an issue with this diagnostic in a toolchain build in #78332, but it feels more like a dependency-related build issue than a problem with this PR.

@tshortli
Copy link
Contributor Author

I hit an issue with this diagnostic in a toolchain build in #78332, but it feels more like a dependency-related build issue than a problem with this PR.

Ah yeah, I think this PR was premature. We need to fix the issue that inspired this change first. PR testing gave me a false sense of security, sorry about that!

@DougGregor
Copy link
Member

DougGregor commented Dec 22, 2024

Yeah, the toolchain build succeeds with this reverted and fails with it in place, so I put up a revert PR (#78345).

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.

4 participants