Skip to content

[SR-15496] Code completion not suggesting members of parameter to closure #57801

@ahoppen

Description

@ahoppen
Previous ID SR-15496
Radar rdar://85602411
Original Reporter @ahoppen
Type Bug
Additional Detail from JIRA
Votes 0
Component/s CodeCompletion
Labels Bug, FoundByStressTester
Assignee None
Priority Medium

md5: 40df6f8ed07123e264ce52e6673e2e52

is duplicated by:

  • SR-15999 Missing dot member completion inside closure

Issue Description:

The following new test case fails. When removing replacing either let ranges or let nsRange by _, the test case passes.

// RUN: %swift-ide-test --code-completion --code-completion-token COMPLETE --source-filename %s | %FileCheck %s

public func test() {
    let ranges = compactMap { (match) in
        let nsRange = match.#^COMPLETE^#
    }
}

struct Foo {
    var x: String
}

func compactMap(_ transform: (Foo) -> Void) {
    fatalError()
}

// CHECK:     Begin completions, 2 items
// CHECK-DAG: Keyword[self]/CurrNominal:          self[#Foo#];
// CHECK-DAG: Decl[InstanceVar]/CurrNominal:      x[#String#];
// CHECK:     End completions

Metadata

Metadata

Assignees

No one assigned

    Labels

    closuresFeature: closurescode completionArea → source tooling: code completionfound by stress testerFlag: An issue found by the SourceKit stress testersource toolingArea: IDE support, SourceKit, and other source toolingunexpected behaviorBug: Unexpected behavior or incorrect output

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions