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

Add BFVoid macro to allow enforcing 'void' result types on BFTask. #289

Merged
merged 2 commits into from
Nov 29, 2016

Conversation

nlutsenko
Copy link
Member

Instead of returning a BFTask with no generic type, or a generic type of 'NSNull' when there is no usable result from a task, we use the type 'BFVoid', which will always have a value of nil.

This allows you to provide a more enforced API contract to the caller, as sending any message to BFVoid will result in a compile time error.

Thank you @richardjrossiii for this hack, it simplifies a lot of boilerplate.
Also cc @GotEmB as it would allow enforcing a lot of API contracts for you.

@nlutsenko nlutsenko added this to the 1.9.0 milestone Nov 23, 2016
@nlutsenko nlutsenko changed the title Add BFVoid macro to allow enforcing no result types on BFTask. Add BFVoid macro to allow enforcing 'void' result types on BFTask. Nov 23, 2016
@nlutsenko nlutsenko merged commit a8a8a1e into master Nov 29, 2016
@nlutsenko nlutsenko deleted the nlutsenko.void branch November 29, 2016 01:38
@seuzxh
Copy link

seuzxh commented Dec 20, 2018

@nlutsenko I saw your explaining about BFVoid. But I'm not sure about this one :

"sending any message to BFVoid will result in a compile time error."

Do you mean [BFVoid continueWithBlock] or [AnyBFTask<BFVoid> continueWithBlock] ?
Thanks for your answer first :)

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

Successfully merging this pull request may close these issues.

2 participants