Skip to content
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

Adapte swift 6 error #71

Open
williamhqs opened this issue Oct 10, 2024 · 0 comments
Open

Adapte swift 6 error #71

williamhqs opened this issue Oct 10, 2024 · 0 comments

Comments

@williamhqs
Copy link

williamhqs commented Oct 10, 2024

When to use this library in swift 6 mode:


    try await withThrowingTaskGroup(of: Bool.self) { group in
            let session = try SSH(host: "xxx", port: xxx)
            // xxx
            let sftp = try session.openSftp()
            for file in files {
                group.addTask { <--- This line comes the error
                    return try await self.upload(file: file, with: sftp, session: session)
                }
            }
}

The error on the addTask:

Value of non-Sendable type '@isolated(any) @async @callee_guaranteed @substituted <τ_0_0> () -> (@out τ_0_0, @error any Error) for <Bool>' accessed after being transferred; later accesses could race; this is an error in the Swift 6 language mode

Please considering to make the related file to sendable could be solve the issue. thanks!

Screenshot 2024-10-10 at 14 08 38

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

No branches or pull requests

1 participant