Skip to content

Unable to infer base of key path from other arguments in code completion #69936

@ahoppen

Description

@ahoppen

The following new test case fails after #69742

// RUN: %batch-code-completion

struct Test {
    var currentHeight: Int

    func subscribeToKeyboardEvents() {
      objectAndKeyPath(object: self, keyPath: \.#^COMPLETE^#)
    }
}

func objectAndKeyPath<Root, Input>(object: Root, keyPath: WritableKeyPath<Root, Input>) {}

// COMPLETE: Decl[InstanceVar]/CurrNominal:      currentHeight[#Int#]; name=currentHeight

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.code completionArea → source tooling: code completion

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions