Skip to content

Cannot using sending with some return value #74846

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

Open
mattmassicotte opened this issue Jun 29, 2024 · 0 comments
Open

Cannot using sending with some return value #74846

mattmassicotte opened this issue Jun 29, 2024 · 0 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. concurrency Feature: umbrella label for concurrency language features

Comments

@mattmassicotte
Copy link
Contributor

Description

Hmm, shouldn't this be allowed? It is a result!

test.swift:7:21: error: 'sending' may only be used on parameters and results
 5 | }
 6 | 
 7 | func makeThing() -> sending some MyProtocol {
   |                     `- error: 'sending' may only be used on parameters and results
 8 |     NonSendable()
 9 | }

Reproduction

protocol MyProtocol {
}

class NonSendable: MyProtocol {
}

func makeThing() -> sending some MyProtocol {
    NonSendable()
}

Expected behavior

No errors

Environment

Apple Swift version 6.0-dev (LLVM 5b37bd4c1c578e9, Swift 54898ce)
Target: arm64-apple-macosx14.0

Additional information

No response

@mattmassicotte mattmassicotte added bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels labels Jun 29, 2024
@hborla hborla added concurrency Feature: umbrella label for concurrency language features and removed triage needed This issue needs more specific labels labels Jul 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. concurrency Feature: umbrella label for concurrency language features
Projects
None yet
Development

No branches or pull requests

3 participants