Skip to content

[CodeCompletion] Pre-remove argument labels from function types #19635

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 1, 2018

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Oct 1, 2018

before checking type relation between candidate types and expected types. In normal compilation, this removal is done in CSGen. However, since code-completion directly uses Constraint System, we have to manually remove argument labels before checking convertibility.

We can remove argument labels unconditionally because function types as value cannot have argument labels. (i.e. var fn: (a: Int) -> Int is illegal). That means, expected types shouldn't have any argument labels.

This fixes regression revealed in 5e75b1a
rdar://problem/41496748

Before checking type relation between candidate types and expected
types. In normal compilation, this removal is done in CSGen. However,
since code-completion directly uses Constraint System, we have to
manually remove argument labels before checking convertibility.

We can remove argument labels unconditionally because function types as
as value cannot have argument labels. (i.e. `let f: (a: Int) -> Int` is
illegal). That means, expected types shouldn't have any argument labels.

This fixes regression revealed in 5e75b1a
rdar://problem/41496748
@rintaro
Copy link
Member Author

rintaro commented Oct 1, 2018

@swift-ci Please smoke test

@rintaro rintaro requested a review from benlangmuir October 1, 2018 11:08
@benlangmuir benlangmuir merged commit e7dd7b2 into swiftlang:master Oct 1, 2018
@rintaro rintaro deleted the ide-rdar41496748 branch October 2, 2018 23:01
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