Value of type 'UnsafePointer<Any>' has no member 'reversed'
natebirkholz opened this issue · comments
Using the brand new XCode Version 9.3 (9E145):
In CRUD.swift, in func insert(documents:ordered:writeConcern:timeout:connection:)
, inside the nested func throwErrors()
I am getting the error "Value of type 'UnsafePointer' has no member 'reversed'" on the line for position in positions.reversed()
It seems that the compiler is having trouble inferring the correct value type for that line, which looks to be Array<InsertErrors.InsertError>
and not UnsafePointer<Any>
This issue has been seen before in the earlier, now-closed issue #101
Any workarounds or changes I can make? I just installed MongoKitten today after updating my XCode, so i don't know if this is traceable to the new XCode 9.3/Swift 4.1 or not.
It was already fixed and tagged, but the tag was marked as 4.0.17 instead of 4.1.2
CC @Obbut
In addition I get a "Command failed due to signal: Abort trap: 6" during compilation of QueryBuilder. The module is included as a dependency of MongoProvider and I'm using the newest Swift 4.1 dev snapshot
That's correct, that issue was also originating from a small bit of Swift compiler regression. It seems to be unable to figure out unwrapping two different double-unwraps of enum cases with the same wrapped types.
Which MongoKitten version is downloaded locally?
4.0.17
Try updating, I just pushed a new version that should resolve this issue.
It still fetches 4.0.17 (vapor fetch
) :(
Try vapor update
instead
As far as I know, MongoDriver has not been upgraded to MongoKitten 4.1, and its Package.swift still lists .Package(url: "https://github.com/OpenKitten/MongoKitten.git", majorVersion: 4, minor: 0),
vapor update
fetches 4.1.3 which fixes the issue, thanks @Joannis
@lauren2020 please update to 4.1.3