Skip to content

Key paths with opaque types cannot be directly initialized. #64341

Open
@JessyCatterwaul

Description

@JessyCatterwaul
struct T {
  let property: Never
}

let keyPath = \T.property
let compiles: PartialKeyPath<some Any> = keyPath
let doesNotCompile: PartialKeyPath<some Any> = \T.property

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfkey pathsFeature: key paths (both native and Objective-C)opaque typesFeature → types: opaque typesswift 5.9type checkerArea → compiler: Semantic analysistype inferenceFeature: type inferenceunexpected errorBug: Unexpected error

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions