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-12827] Improve diagnostic for keypath with root type that cannot be inferred #55273

Closed
hamishknight opened this issue May 17, 2020 · 2 comments
Labels
compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation improvement type checker Area → compiler: Semantic analysis

Comments

@hamishknight
Copy link
Collaborator

Previous ID SR-12827
Radar None
Original Reporter @hamishknight
Type Improvement
Status Closed
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Improvement, DiagnosticsQoI, TypeChecker
Assignee None
Priority Medium

md5: 09d7d4d8ace51e7d45286ac9e3037caf

Issue Description:

For the following we currently emit:

func foo<T>(_ fn: (T) -> String) {}
foo(\.x) // error: Generic parameter 'T' could not be inferred

It would be better to point to the key path itself and say that the root type could not be inferred.

@LucianoPAlmeida
Copy link
Collaborator

Fixed on master #31848
cc @hamishknight 🙂

@hamishknight
Copy link
Collaborator Author

Thanks!

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation improvement type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

2 participants