Skip to content

[CodeCompletion] nil/[]/[:] default arguments are "interesting" #40079

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

Merged
merged 1 commit into from
Nov 9, 2021

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Nov 6, 2021

Code completion didn't suggest "without default argument" call pattern variant for functions with nil default arguments. e.g.

func foo(arg: Int? = nil)

This should suggest foo(arg:) as well as foo().

rdar://85077605

func foo(arg: Int? = nil)

Code completion didn't sugget 'foo()' call pattern variant for this
function.
@rintaro
Copy link
Member Author

rintaro commented Nov 6, 2021

@swift-ci Please smoke test

@rintaro rintaro requested a review from bnbarham November 8, 2021 21:30
Copy link
Contributor

@bnbarham bnbarham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

case DefaultArgumentKind::StoredProperty:
case DefaultArgumentKind::Inherited: // FIXME: include this?
return true;
default:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Hopefully this will help in the future :)

@rintaro rintaro merged commit 8ed71f0 into swiftlang:main Nov 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants