orlandos-nl / MongoKitten

Native MongoDB driver for Swift, written in Swift

Home Page:https://orlandos.nl/docs/mongokitten/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

I get 4.1.2 currently.
412

Weird, I'm getting it trough MongoDriver (dependency of MongoProvider)
screen shot 2018-04-03 at 00 20 25

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),

Thanks @Joannis. I now have 4.0.19 (@Obbut works because it's not 4.1.*)

vapor update fetches 4.1.3 which fixes the issue, thanks @Joannis

I updated to 4.1.2 but its still throwing the same error on "positions.reversed()"

image
image

Is there anything that needs changed that I'm missing?

@lauren2020 please update to 4.1.3