You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have read CONTRIBUTING and have done my best to follow them.
What did you do?
I attempted to use Custom Validation.
What did you expect to happen?
I expected the code sample provided in Custom Validation to provide working code.
What actually happened instead?
This code as written does not compile:
expect{
guard case .enumCaseWithAssociatedValueThatIDontCareAbout = actual else{return.failed(reason:"wrong enum case")}return.succeeded
}.to(succeed())
The return statements produce the errors:
Type '(() -> ToSucceedResult)?' has no member 'succeeded'
Type '(() -> ToSucceedResult)?' has no member 'failed'
Instead, each case needed to be wrapped in a closure:
expect{
guard case .enumCaseWithAssociatedValueThatIDontCareAbout = actual else{return{.failed(reason:"wrong enum case")}}return{.succeeded }}.to(succeed())
Environment
List the software versions you're using:
Quick: 4.0.0
Nimble: 9.1.0
Xcode Version: 13.2.1 (13C100)
Swift Version: Xcode Default
Please also mention which package manager you used and its version. Delete the
other package managers in this list:
Thanks for the issue & pull request. This should be related to #824 and returning a closure (like return { .succeeded }) is not expected. I'll revisit the succeed() implementation.
What did you do?
I attempted to use Custom Validation.
What did you expect to happen?
I expected the code sample provided in Custom Validation to provide working code.
What actually happened instead?
This code as written does not compile:
The
return
statements produce the errors:Instead, each case needed to be wrapped in a closure:
Environment
List the software versions you're using:
Please also mention which package manager you used and its version. Delete the
other package managers in this list:
http_archive
toolSample project:
The text was updated successfully, but these errors were encountered: