Skip to content

[Sema][SR-15179] Ignore FunctionArgument inout mismatch if there is already a fix for locator #39257

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 3 commits into from
Sep 13, 2021

Conversation

LucianoPAlmeida
Copy link
Contributor

@LucianoPAlmeida LucianoPAlmeida commented Sep 11, 2021

Just ignore the inout fix for individual FunctionArgument if there is a fix already in place.

Resolves: SR-15179
Resolves: rdar://problem/82924296

@hamishknight
Copy link
Contributor

hamishknight commented Sep 13, 2021

Thanks for fixing this! This looks good to me, though I'll let Pavel have the final say.

I meant to add this to the original bug report, but there are also a couple of other similar cases that also need fixing, e.g:

func tuplify<Ts>(_ fn: (Ts) -> Void) {}
func fn(x: Int..., y: Int...) {}
tuplify(fn)

actor A {}
func isolatedFn(_ x: isolated A, _ y: isolated A) {}
tuplify(isolatedFn)

Both calls to tuplify will emit duplicate diagnostics.

If you want to take a look at fixing these too (either in this PR or a follow-up), I can edit the original bug report to include them, or otherwise file a new bug if you want.

@LucianoPAlmeida
Copy link
Contributor Author

LucianoPAlmeida commented Sep 13, 2021

Thanks for fixing this! This looks good to me, though I'll let Pavel have the final say.

I meant to add this to the original bug report, but there are also a couple of other similar cases that also need fixing, e.g:

func tuplify<Ts>(_ fn: (Ts) -> Void) {}
func fn(x: Int..., y: Int...) {}
tuplify(fn)

actor A {}
func isolatedFn(_ x: isolated A, _ y: isolated A) {}
tuplify(isolatedFn)

Both calls to tuplify will emit duplicate diagnostics.

If you want to take a look at fixing these too (either in this PR or a follow-up), I can edit the original bug report to include them, or otherwise file a new bug if you want.

Ah sure, is the same issue so I think we can include them in the same SR and I can adjust in this PR no problem :)

@xedin
Copy link
Contributor

xedin commented Sep 13, 2021

@swift-ci please smoke test

@LucianoPAlmeida
Copy link
Contributor Author

@swift-ci Please smoke test

@xedin
Copy link
Contributor

xedin commented Sep 13, 2021

@swift-ci please smoke test Windows platform

@LucianoPAlmeida
Copy link
Contributor Author

@swift-ci Please smoke test MacOS platform

@xedin xedin merged commit 7c653e4 into swiftlang:main Sep 13, 2021
@LucianoPAlmeida LucianoPAlmeida deleted the SR-15179-dupe-arg-fix branch September 13, 2021 23:11
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.

3 participants