Skip to content

@usableFromInline internal type doesn't get Sendable conformance synthesised #70019

Open
@dnadoba

Description

@dnadoba
@usableFromInline
struct Foo {
    var integer: Int
}

struct Bar: Sendable {
    var foo: Foo // warning: Stored property 'foo' of 'Sendable'-conforming struct 'Bar' has non-sendable type 'Foo'
}

This warning only makes sense if the compiled with library evolution mode but this warning is also emitted if compiled without library evolution mode.
If @usableFromInline is removed from Foo the Sendable conformance is synthesised as expected.

Environment

  • Swift compiler version info: swift-driver version: 1.87.3 Apple Swift version 5.9.2 (swiftlang-5.9.2.2.51 clang-1500.1.0.2.2)

Metadata

Metadata

Assignees

No one assigned

    Labels

    @usableFromInlineFeature → attributes: The @usableFromInline attributeSendableArea → standard library: The Sendable protocolattributesFeature: Declaration and type attributesbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfconcurrencyFeature: umbrella label for concurrency language featuresconformancesFeature → protocol: protocol conformancesderived conformancesFeature → protocol → conformances: derived conformances aka synthesized conformancesswift 6.0type checkerArea → compiler: Semantic analysisunexpected warningBug: Unexpected warning

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions