Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-14800] Missing argument label completion in return value of single expression closure that has return type restricted by protocol #57148

Closed
ahoppen opened this issue Jun 21, 2021 · 1 comment · Fixed by #70012
Labels
argument labels Feature: function argument labels bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. call expressions Feature → expressions: Call expressions closures Feature: closures code completion Area → source tooling: code completion expressions Feature: expressions generic constraints Feature → generics: generic constraints generics Feature: generic declarations and types source tooling Area: IDE support, SourceKit, and other source tooling unexpected behavior Bug: Unexpected behavior or incorrect output

Comments

@ahoppen
Copy link
Contributor

ahoppen commented Jun 21, 2021

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

md5: cbe1b9223a27fe7410540c89dc821d9c

relates to:

Issue Description:

In the following test case contentMode is not being suggested.

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

protocol MyProtocol {}
struct MyStruct: MyProtocol {
  func aspectRatio(contentMode: Int) -> MyStruct { fatalError() }
}

func foo<I>(content: (MyStruct) -> I) where  I : MyProtocol { fatalError() }

func bazx() {
  foo() { image in
    image.aspectRatio(#^COMPLETE^#)
  }
}

When removing the restriction of I: MyProtocol we are correctly suggesting conentMode.

@ahoppen
Copy link
Contributor Author

ahoppen commented Jun 21, 2021

This might be related to #57087 not sure.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the source tooling Area: IDE support, SourceKit, and other source tooling label Feb 6, 2023
ahoppen added a commit to ahoppen/swift that referenced this issue Nov 23, 2023
The issue no longer occurs on `main`. Add a test case for it.

Fixes apple#57148
Fixes apple#57149
ahoppen added a commit to ahoppen/swift that referenced this issue Nov 24, 2023
The issue no longer occurs on `main`. Add a test case for it.

Fixes apple#57148
Fixes apple#57149
ahoppen added a commit to ahoppen/swift that referenced this issue Nov 24, 2023
The issue no longer occurs on `main`. Add a test case for it.

Fixes apple#57148
Fixes apple#57149
ahoppen added a commit to ahoppen/swift that referenced this issue Nov 24, 2023
The issue no longer occurs on `main`. Add a test case for it.

Fixes apple#57148
Fixes apple#57149
@AnthonyLatsis AnthonyLatsis added closures Feature: closures expressions Feature: expressions argument labels Feature: function argument labels call expressions Feature → expressions: Call expressions generics Feature: generic declarations and types generic constraints Feature → generics: generic constraints unexpected behavior Bug: Unexpected behavior or incorrect output labels Nov 24, 2023
ahoppen added a commit that referenced this issue Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
argument labels Feature: function argument labels bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. call expressions Feature → expressions: Call expressions closures Feature: closures code completion Area → source tooling: code completion expressions Feature: expressions generic constraints Feature → generics: generic constraints generics Feature: generic declarations and types source tooling Area: IDE support, SourceKit, and other source tooling unexpected behavior Bug: Unexpected behavior or incorrect output
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants