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
Compiler crash with SE-0430 "transferring" parameters and result values #73316
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
crash
Bug: A crash, i.e., an abnormal termination of software
triage needed
This issue needs more specific labels
Comments
groue
added
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
crash
Bug: A crash, i.e., an abnormal termination of software
triage needed
This issue needs more specific labels
labels
Apr 28, 2024
Package that reproduces the crash: Issue73316.zip |
A different snippet that crashes in a similar way: struct Helper<T> {
let resolve: @Sendable () throws -> transferring T
init(_ resolve: @escaping @Sendable () throws -> transferring T) {
self.resolve = resolve
}
}
struct Worker {
func f(_ closure: @escaping @Sendable () -> transferring [Int]) {
Helper(closure)
}
} Crash log
The snippet below crashes differently. Note that the code is invalid because there is an invalid closure conversion from non-transferring result to transferring result): struct Helper<T> {
let resolve: @Sendable () throws -> transferring T
init(_ resolve: @escaping @Sendable () throws -> transferring T) {
self.resolve = resolve
}
}
struct InvalidWorker {
func f(_ closure: @escaping @Sendable () -> [Int]) {
Helper(closure)
}
} Crash log
|
cc: @gottesmm |
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.
crash
Bug: A crash, i.e., an abnormal termination of software
triage needed
This issue needs more specific labels
Description
The compiler crashes when it compiles a code snippet that involves a
transferring
result value.Reproduction
Stack dump
Expected behavior
No crash.
Environment
Additional information
Removing the
transferring
keyword removes the crash. This compiles fine:However I intend to let users provide
IntBuilder
instances that are not Sendable, hence my desire to usetransferring
(if I got SE-0430 right).The text was updated successfully, but these errors were encountered: