Skip to content

[code-completion] Complete as function reference when the type matches #5136

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
Oct 5, 2016

Conversation

benlangmuir
Copy link
Contributor

If we're completing in a context that expects a function type, try to
match methods/functions as function references before trying them as
calls. This means that

func take(_: (Int)->()) {}
func foo(a: Int) {}
take(#^A^#) // completes foo(a:) instead of foo(a: {#value#})

Note: doesn't yet work with generic types.

rdar://problem/28435922

If we're completing in a context that expects a function type, try to
match methods/functions as function references before trying them as
calls.  This means that

func take(_: (Int)->()) {}
func foo(a: Int) {}
take(#^A^#)  // completes foo(a:)  instead of foo(a: {#value#})

Note: doesn't yet work with generic types.

rdar://problem/28435922
@benlangmuir
Copy link
Contributor Author

@swift-ci Please smoke test and merge.

@swift-ci swift-ci merged commit 2f079df into swiftlang:master Oct 5, 2016
@benlangmuir benlangmuir deleted the cc-func-ref-1 branch October 5, 2016 22:08
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