Skip to content

Conversation

@slavapestov
Copy link
Contributor

If the thrown error type is address-only, our function type has an indirect error result. Handle this in type lowering and SILGen prolog/epilog emission.

Next steps are introducing a zero-operand throw_addr instruction to exit out of a block after initializing the thrown error result, and setting up a stack-allocated box to receive the indirect error result from a try_apply, all the conversions and re-abstraction support, etc.

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

Copy link
Member

Choose a reason for hiding this comment

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

We ban tuple types from being thrown up in the type checker now, and even if we allowed them there... I think we'd still pass them indirectly here, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, I’ll remove this. It was just a copy and paste

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (SILModuleConventions(M).loweredAddresses) {
if (SILModuleConventions(M).useLoweredAddresses()) {

@slavapestov slavapestov force-pushed the silgen-typed-throws-wip branch from 52d69a9 to 581776b Compare October 27, 2023 21:38
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

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