You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While experimenting with an idea using KeyPaths (which I've not heavily used previously) the Swift compiler (4.2, Xcode 10.1) began crashing with the following stack trace:
It took me a few minutes to figure out the file of my source code that was the cause of the error and after doing some more reading on KeyPaths I discovered I wasn't satisfying the requirements of the generics associated with KeyPaths.
While I was able to work around the seg fault, the compiler does not seem robust in this area. I received no diagnostic messaging, only the unceremonious crash.
While I'm not in a position to share my source code (which I have subsequently changed significantly), I believe the offending code was
I can replicate the crash by adding this snippet to my project. (I now understand why this code is wrong, it's just unfortunate that it causes a crash.)
No, I have not tried this with the Swift 5 compiler.
Here is one other compiler stack traces from my project build history related to efforts in this area.
<stdin>:4:42: error: reference to generic type 'KeyPath' requires arguments in <...>
typealias KeyPathStringIdentifier = (KeyPath, String)
^
<Any, Any>
Swift.KeyPath:1:14: note: generic type 'KeyPath' declared here
public class KeyPath<Root, Value> : PartialKeyPath<Root> {
^
<stdin>:5:40: error: reference to generic type 'KeyPath' requires arguments in <...>
typealias KeyPathDateIdentifier = (KeyPath, Date)
^
<Any, Any>
Swift.KeyPath:1:14: note: generic type 'KeyPath' declared here
public class KeyPath<Root, Value> : PartialKeyPath<Root> {
^
<stdin>:6:36: error: reference to generic type 'KeyPath' requires arguments in <...>
typealias KeyPathIdentifier = (KeyPath, Comparable)
^
<Any, Any>
Swift.KeyPath:1:14: note: generic type 'KeyPath' declared here
public class KeyPath<Root, Value> : PartialKeyPath<Root> {
^
Thanks for the confirmation. I attempted to validate the improved error messaging in my project but unfortunately I encountered https://bugs.swift.org/browse/SR-9910 in the process.
Additional Detail from JIRA
md5: 54eb1c2206f79ed0432e7c5e05e21ff2
Issue Description:
While experimenting with an idea using KeyPaths (which I've not heavily used previously) the Swift compiler (4.2, Xcode 10.1) began crashing with the following stack trace:
It took me a few minutes to figure out the file of my source code that was the cause of the error and after doing some more reading on KeyPaths I discovered I wasn't satisfying the requirements of the generics associated with KeyPaths.
While I was able to work around the seg fault, the compiler does not seem robust in this area. I received no diagnostic messaging, only the unceremonious crash.
While I'm not in a position to share my source code (which I have subsequently changed significantly), I believe the offending code was
I can replicate the crash by adding this snippet to my project. (I now understand why this code is wrong, it's just unfortunate that it causes a crash.)
No, I have not tried this with the Swift 5 compiler.
Here is one other compiler stack traces from my project build history related to efforts in this area.
The text was updated successfully, but these errors were encountered: