I have an odd issue I’m experiencing. I’m getting ...
# kotlin-native
s
I have an odd issue I’m experiencing. I’m getting a crash in a swift codebase calling into a companion obeject. The message is being sent to the wrong companion object and it is crashing. More details in the thread.
I created a UUID common object and wrapped the native UUID objects in it. This was fine in older code because when calling from swift it still had the framework name as a prefix. Now though in order to disambiguate them I have to write myframework.UUID which should be fine. However when I call myframework,UUID.companion().create() it sends the message to a different companion object and the app crashes. The code is open source so can be found at https://github.com/samus/pistachio/blob/master/native-example-ios/Pistachio-iOS%20Example/ViewController.swift
I have worked around this by converting the wrapping expect/actual UUID type to an expect class and type aliases to the platforms UUID types.
s
I can’t reproduce the issue. Have you tried using newest Xcode? This crash may be related to Swift compiler bug.
s
Were you trying to replicate from the latest commit or from this one?
8cf75aff4a237d6f825c34e444f942a567396ce6
I am using Xcode 10.1. Usually when I see weird things like this I clean the project and delete Xcode's derived data. None of that worked.
s
8cf75aff4a237d6f825c34e444f942a567396ce6
Yes, I’m using this commit.
I am using Xcode 10.1.
This is strange, because to make this code compilable in Xcode 10.1 I had to replace
UITableViewCellEditingStyle
by
UITableViewCell.EditingStyle
. Do you use custom Swift toolchain in Xcode 10.1?
Ok, I’ve found that your example project has custom Swift version specified. However this doesn’t seem to have any effect on reproducing the issue. I can’t reproduce it with project from the repository too.
s
I will check out that commit again and see if I can still reproduce the problem.
I checked out the commit again and couldn't reproduce the error. It must have been some stale build output lying around. Thanks for looking into this.
s
Thank you for checking the commit again 🙂