Closed ole closed 7 years ago
👍 for hard-wrapping the commit message at 72. Love it.
I never do this for my own stuff, but I figured, let's be a nice open-source citizen every once in a while. 😜
I forgot, here's a screenshot of the crash in Xcode 8.3.2 for posterity:
This removes the constraint on Collection.IndexDistance on
Changeset
andEdit
. Conversions between integer types are a little annoying in Swift, especially in Swift 3. Before the revamp of the integer protocols in SE-0104, we have to go throughIntMax
to convert between integer types. We should be able to remove thetoIntMax()
calls when we drop Swift 3 support.More importantly, while this code currently compiles, it crashes with this runtime error when running the unit tests:
The same crash happens in Xcode 8.3.2 and Xcode 9b4 (Swift 3 mode; I haven't checked if it was fixed in Swift 4).
Related bugs:
The crash has something to do with nested generic type metadata. As suggested in one of the issues on JIRA, the crash goes away if we make the enum inside Edit indirect:
I don't know if this is supposed to be a final fix or just a workaround and this issue will eventually be fixed.
Until then, it's probably not worth merging this since the
IndexDistance == Int
constraint is not a very big deal in practice. But I wanted a place to show you the changes that would be needed, that's why I opened this PR.