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

Xcode 9 - "Task" error #63

Closed
Samigos opened this issue Sep 23, 2017 · 13 comments
Closed

Xcode 9 - "Task" error #63

Samigos opened this issue Sep 23, 2017 · 13 comments

Comments

@Samigos
Copy link

Samigos commented Sep 23, 2017

I just upgraded Xcode, now with Swift 4 and an error has occurred at the Task swift file! See picture below:

screenshot at sep 23 15-09-58

It seems the success case needs an argument...
Have in mind I already have upgraded the SDK with cocoapods.

Thanks in advance!

@akwilliamson
Copy link

akwilliamson commented Sep 23, 2017

This has been fixed in the pull request I submitted yesterday. Hopefully it gets merged. Until then, change .success() to .success(()) by added empty parentheses

Edit: Swift 4 changes have been merged.

@josmanperez
Copy link

Hi! I'm using the latest release (1.3.0) and I'm still seeing that error.
Plus in the same file there is two warnings When calling this function in Swift 4 or later, you must pass a '()' tuple; did you mean for the input type to be '()'? and one error, but the error goes away when you fix the warning.

You've said that the changes have been merged but the latest release doesn't said anything about Swift 4 changes.

Thank you!

@akwilliamson
Copy link

That's because the podspec hasn't been updated to 1.4.0 yet since this repo doesn't seem to be well-looked-after. I posted an issue about it 3 weeks ago here. Until that happens you'll need to explicitly point to the repo in your Podfile.

@josmanperez
Copy link

Thank you so much @akwilliamson :)

@marchy
Copy link

marchy commented Nov 29, 2017

@akwilliamson mind including how to point to the explicit repo for it?

@Tudmotu
Copy link

Tudmotu commented Dec 1, 2017

I think this is it @marchy:
https://guides.cocoapods.org/using/the-podfile.html#from-a-podspec-in-the-root-of-a-library-repo

Basically you should put this in your Podfile:

pod 'Bolts-Swift', :git => 'https://github.com/BoltsFramework/Bolts-Swift'

@marchy
Copy link

marchy commented Dec 1, 2017

Fantastic, thanks for that @Tudmotu :)

@CiraciNicolo
Copy link

CiraciNicolo commented Jan 23, 2018

I'm using this project via ParseLiveQuery and I'm still having this issue. It seems that the wrong commit is pulled.

@carnivash
Copy link

I am also using via ParseLiveQuery and the problem persists, i managed to fix the first error using the above suggestion:
change this: return Task(state: .success())
to this: return Task(state: .success(()))

but just below there is another problem on the line:

self.trySet(state: TaskState.fromClosure(closure))

Cannot convert value of type '(Void) throws -> TResult' to expected argument type '() throws ->

Is there any suggestion to fix this? Thanks.

@sjmerel
Copy link

sjmerel commented Feb 20, 2018

I had to do this:
pod 'Bolts-Swift', :git => 'https://github.com/BoltsFramework/Bolts-Swift', :commit => 'e9baa72d04521c3b25ef4fa6fef12b340953ee02'

@sambing
Copy link

sambing commented Jul 6, 2018

Issue still persists, if the above solutions are not followed.

@jeffreyjackson
Copy link

thanks @sjmerel your specific commit worked for me too.

@Verma-Mayank
Copy link

Still having this issue. Tried all of the above.

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

No branches or pull requests