Skip to content

Provide a fix-it that inserts omitted generic parameters when they can't be inferred. #4936

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

Conversation

jrose-apple
Copy link
Contributor

  • Explanation: If someone tries to use a generic type without providing generic arguments, they'll get an error about how the generic parameters couldn't be inferred. In these cases, the most helpful thing to do is insert reasonable default types or placeholders. Provide a note with a fix-it, and auto-apply that fix-it during migration.
  • Scope: Affects failure diagnosis for generic types without generic arguments, in both type and expression position.
  • Issue: rdar://problem/27087345
  • Reviewed by: @nkcsgexi
  • Risk: Medium-low. Only fires during error diagnosis, but it is looking up a fair amount of information to do its work, which could mean exposing latent bugs. Most likely, though, the worst that will happen is it generates a bogus fix-it at some point.
  • Testing: Added compiler regression tests, verified that the originally reported case now gets useful fix-its.

Provide a fix-it that inserts omitted generic parameters when they can't be inferred.

rdar://problem/27087345
@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@tkremenek tkremenek merged commit eb68737 into swiftlang:swift-3.0-branch Sep 23, 2016
@jrose-apple jrose-apple deleted the swift-3-generic-param-fix-it branch September 23, 2016 15:43
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