Skip to content

Can't use output: .string with body closure #63

@krzyzanowskim

Description

@krzyzanowskim

Describe the bug
Can't compile run(executable, output: .string, body: body)

To Reproduce

/// Global function 'run(_:arguments:environment:workingDirectory:platformOptions:output:isolation:body:)' requires the types 'BytesOutput.OutputType' (aka 'Array<UInt8>') and '()' be equivalent
let r3 = try await Subprocess.run(.path("/bin/true"), output: .bytes) { execution, input, output in
    [1] as [UInt8]
}

/// Global function 'run(_:arguments:environment:workingDirectory:platformOptions:output:isolation:body:)' requires the types 'StringOutput<Unicode.UTF8>.OutputType' (aka 'Optional<String>') and '()' be equivalent
let r4 = try await Subprocess.run(.path("/bin/true"), output: .string) { execution, input, output in
    "" as String?
}

Expected behavior
A clear and concise description of what you expected to happen.

Environment (please complete the following information):

  • macOS 15
  • swift-driver version: 1.120.5 Apple Swift version 6.1.2 (swiftlang-6.1.2.1.2 clang-1700.0.13.5)

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions