The “All” thing was fixed for the upcoming beta build already.
so for ifdefs:
#if cocoa
...
#endif
the 3 errors I have left:
issue73929_1.swift (76:32) E44 No member "map" on type "INSFastEnumeration<Promise>!"
issue73929_1.swift (231:32) E44 No member "enumerate" on type "Array<Promise!.thenClosure>!"
issue73929_1.swift (266:9) E399 No overloaded method "cat" with 1 parameter on type "Promise!"
I’ve logged an issue to expose/fix the map & enumerate apis. (bugs://73940)
THe other one I’ll be looking into too, cat is a block pointer, it should be invokable.
@ck you’re welcome!
In the meanwhile waiting for the beta update, I did some small changes on the repo, reducing the error to (just) 4:
First, I have changed
var cat: catchClosure
directly to
var cat: (AnyObject?) -> ()
Then I replaced functional map, reduce, filter to ordinary for-loop statements:
//let filteredNils = self.promises.filter( { (p) -> (Bool) in return (p.value != nil) } )
var filteredNils = [AnyObject]()
for el in self.promises {
if(el.value != nil) {
filteredNils.append(el.value!)
}
}
//let values = filteredNils.map( { (p) -> (AnyObject) in print(p.value); return p.value! } )
var values = [AnyObject]()
for el in filteredNils {
values.append(el)
}
Last (4) errors are
/Volumes/MacHDD2/Developmemt/ParisiLabs/swift-promise-example/StaticLibrary/SharedProject/Promise.swift(58,3): error E121: Cannot instantiate interface type "Action2<Action1<AnyObject?>!,Action1<AnyObject?>!>!"
/Volumes/MacHDD2/Developmemt/ParisiLabs/swift-promise-example/StaticLibrary/SharedProject/Promise.swift(62,11): error E43: No static member "All" on type "Promise"
/Volumes/MacHDD2/Developmemt/ParisiLabs/swift-promise-example/StaticLibrary/SharedProject/Promise.swift(67,8): error E406: No overloaded method "then" with these parameters on type "Promise!", best matching overload is "then(_ then: Promise!.thenClosureNoReturn) -> Promise"
/Volumes/MacHDD2/Developmemt/ParisiLabs/swift-promise-example/StaticLibrary/SharedProject/Promise.swift(167,32): error E44: No member "enumerate" on type "swift.Array<Promise!.thenClosure>!"
Hello,
I have updated Fire to the lasted DMG on Mac, RemObjects Fire - 8.3.92.1905, Sat, Dec 19, 2015.
Considering the latest commit on the swift example for the Promise, https://github.com/loretoparisi/swift-promise-example
I report the following errors:
/Volumes/MacHDD2/Developmemt/ParisiLabs/swift-promise-example/StaticLibrary/SharedProject/Promise.swift(58,3): error E121: Cannot instantiate interface type "Action2<Action1<AnyObject?>,Action1<AnyObject?>>!"
/Volumes/MacHDD2/Developmemt/ParisiLabs/swift-promise-example/StaticLibrary/SharedProject/Promise.swift(62,11): error E43: No static member "All" on type "Promise"
/Volumes/MacHDD2/Developmemt/ParisiLabs/swift-promise-example/StaticLibrary/SharedProject/Promise.swift(167,32): error E44: No member "enumerate" on type "swift.Array<Promise!.thenClosure>!"
/Volumes/MacHDD2/Developmemt/ParisiLabs/swift-promise-example/StaticLibrary/SharedProject/Promise.swift(179,66): error E572: Cannot assign null to non-nullable "Action1<AnyObject?>"
/Volumes/MacHDD2/Developmemt/ParisiLabs/swift-promise-example/StaticLibrary/SharedProject/Promise.swift(180,67): error E572: Cannot assign null to non-nullable "com.remobjects.elements.system.Action"
/Volumes/MacHDD2/Developmemt/ParisiLabs/swift-promise-example/StaticLibrary/SharedProject/Promise.swift(311,23): error E500: Parenthesis are required to call method observe(), cannot assign method group to "Action1<Promise>"
Of course, I do not know if this beta came with issues described in this thread.
It did yes. but I solved pretty much only OSX/iOS issues.I’ll create a new bug to look at this too, but this week and next week are going to be busy so I can’t promise when I look at them.
Uhm right, that sounds weird since the project compiles and run on Xcode 7.1.1 (that I assume is running Swift 2.1), but actually I see that the lazy sequences
Last login: Mon Dec 21 23:40:38 on ttys001
macbookproloreto:~ admin$ swift
Welcome to Apple Swift version 2.1.1 (swiftlang-700.1.101.15 clang-700.1.81). Type :help for assistance.
1> print( ["one","two","three"].reduce("",combine:{$0 + $1}) )
onetwothree
error E121: Cannot instantiate interface type "Action2<Action1<AnyObject?>,Action1<AnyObject?>>!"
this looks like a compiler bug; logging.
error E500: Parenthesis are required to call method observe(), cannot assign method group to "Action1<Promise>"
this too. the method SHOULD be assignable to the closure. will log.
error E43: No static member "All" on type "Promise"
this looks like a valid bug. what’s All supposed to be? i don’t see it defined
error E44: No member "enumerate" on type "swift.Array<Promise!.thenClosure>!"
this one’s a missing function in the base library; will implement. although to be honest i don’t quiet GET what this function is supposed to do. other than return the same sequence again?
error E572: Cannot assign null to non-nullable "Action1<AnyObject?>"
error E572: Cannot assign null to non-nullable "com.remobjects.elements.system.Action"
these are valid too. bur closure’s are not defined to be nullable. so you cant set them to nil. changing them to
Thanks a lot, we are almost done then!
The nullable fixes the var definitions. The enumerate function from Swift 2.1 works on a collection returning the index and the value. It is not supposed to work on mutable collections.
So in the meanwhile I have replaced it with a fast enumerator
for (_, then) in self.thens.enumerate() {
//...
}
that is simple as
for then in self.thens.enumerate() {
}
So at this stage, we have 3 errors on the updated repo:
/StaticLibrary/SharedProject/Promise.swift(56,3): error E121: Cannot instantiate interface type "Action2<Action1<AnyObject?>,Action1<AnyObject?>>!"
/StaticLibrary/SharedProject/Promise.swift(60,11): error E43: No static member "All" on type "Promise"
/StaticLibrary/SharedProject/Promise.swift(309,23): error E500: Parenthesis are required to call method observe(), cannot assign method group to "Action1<Promise>"
0 Warning(s)
3 Error(s)
@warn_unused_result public func enumerate() -> ISequence<(Int, T)> {
var index = 0
for element in self {
__yield (index, element)
}
}
should do? i missed that subtlety from the docs. (coz frankly, how this is defined in the docs make this next to unparsable). Fixed in github and for the next beta.
Will have a look again.
i’ll check. maybe this wasn’t in the beta you had, yet? Update it’s not in mine either. Sure this was supposed too have bene implemented yet?