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

[Sema] Fix SR-1681 spurious "unused result" warning #4625

Merged
merged 2 commits into from Sep 6, 2016

Conversation

timbodeit
Copy link
Contributor

Extends ea52d4f to support methods returning optional types.

When an optionally chained method already has an optional return type, the corresponding CallExpr is not wrapped in an InjectIntoOptionalExpr. Instead an OptionalEvaluationExpr can have a CallExpr directly as its SubExpr in this case.

I'm not sure if the cast to CallExpr is even needed, but put it in for safety reasons. If someone can confirm whether or not it makes sense to keep it in there, and if there are other types that could be relevant as a SubExpr, please let me know.

Resolves SR-1681.

An OptionalEvaluationExpr can have a CallExpr directly as its SubExpr,
if the CallExpr already has optional type.

extends ea52d4f
@slavapestov
Copy link
Member

@swift-ci Please test

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.

None yet

2 participants