Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
We couldn’t find any files to show.

This comment has been minimized.

Copy link
Owner Author

@cdzombak cdzombak commented Jan 22, 2015

Note that line 11 has changed to an explicit return Void() (instead of the comment with the compiler's error message).

The optional method chaining on line 10 was returning a Void?, as it should. And though I always intended the block to return Void, this was a single-line block, so its inferred return type was that of its one line: Void?.

Adding the explicit return Void() allows the compiler to infer that the block does, in fact, return Void.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment