Skip to content

DocC omits @Sendable annotations in methods #1358

@heckj

Description

@heckj

Description

Following up from the Swift Forums thread: DocC omits @Sendable. Bug or intentional?.

Ole provided a small example and output that shows DocC clearly missing the @sendable annotation, which I suspect is a miss underneath in the symbol graph extraction/generation logic, akin to the issue with labeling classes as actors in #212.

This was originally citing about method parameters, but per Slava pointed out:

bear in mind that unlike @autoclosure for example, @Sendable is not a parameter option, because it can appear anywhere within a type, for example func f(_: Array<@Sendable () -> ()>).

Checklist

  • If possible, I've reproduced the issue using the main branch of this package.
  • This issue hasn't been addressed in an existing GitHub issue.

Expected Behavior

The documentation generated for a symbol includes @sendable annotations, if applied in the source

Actual behavior

The @sendable annotation isn't reflected in documentation.

Steps To Reproduce

  • Create a project with the sample code:
struct StructWithSendable {
    public func doSomething(_ body: @Sendable () -> Void) {}
}
  • Generate content for it
  • View the resulting symbol in documentation, it should be something akin to:
func doSomething(_ body: @Sendable () -> Void)

Swift-DocC Version Information

6.2.1

Swift Compiler Version Information

swift-driver version: 1.127.14.1 Apple Swift version 6.2 (swiftlang-6.2.3.3.2 clang-1700.6.3.2)
Target: arm64-apple-macosx26.0

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