Skip to content

[sending] Look through the sending type repr when printing the type of a function result using the type repr fallback path. #76491

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
Sep 18, 2024

Conversation

gottesmm
Copy link
Contributor

@gottesmm gottesmm commented Sep 16, 2024

[sending] Look through the sending typerepr when printing the type of a function result using the type repr fallback path.

When we print types in the AST printer if for some reason we cannot find the
appropriate type to print, we fall back and use a type repr instead. This
behavior is a fallback case that is hit rarely (or we would have seen this
behavior earlier).

This behavior causes a problem due to the implementation of sending results
using a sending type repr to communicate that the relevant Function has a
sending result, but we actually do not use the sending type repr from that point
on. So as a result, in this fallback case, we put in one too many sending on the
result.

Previously, it was pretty hard to test this codepath, so I added a small option
that is available only in asserts builds that turns on the type repr behavior
all the time.

rdar://135594964

@gottesmm
Copy link
Contributor Author

@swift-ci smoke test

@gottesmm gottesmm changed the title [sending] Look through the sending type error when printing the type of a function result using the type repr fallback path. [sending] Look through the sending type repr when printing the type of a function result using the type repr fallback path. Sep 16, 2024
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test

@gottesmm gottesmm force-pushed the rdar135594964 branch 2 times, most recently from cf652e5 to fb4f307 Compare September 17, 2024 23:25
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test

…f a function result using the type repr fallback path.

When we print types in the AST printer if for some reason we cannot find the
appropriate type to print or if the user explicitly asks, we fall back and use a
type repr instead.

This behavior causes a problem due to the implementation of sending results
using a sending type repr to communicate that the relevant function has a
sending result, but we actually do not use the sending type repr from that point
on. So as a result, in this fallback case, we put in one too many sending on the
result.

rdar://135594964
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test

@gottesmm
Copy link
Contributor Author

Failed to compile in LLVM

@gottesmm
Copy link
Contributor Author

@swift-ci smoke test macOS platform

@gottesmm gottesmm merged commit 2eea17a into swiftlang:main Sep 18, 2024
3 checks passed
@gottesmm gottesmm deleted the rdar135594964 branch September 18, 2024 17:38
@gottesmm
Copy link
Contributor Author

@tshortli made the FileCheck change you requested here: #76554

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