Skip to content

Instantly share code, notes, and snippets.

@Noobish1
Created September 21, 2016 14:01
Show Gist options
  • Save Noobish1/b916bd29bfc304af95333d0ef891cff6 to your computer and use it in GitHub Desktop.
Save Noobish1/b916bd29bfc304af95333d0ef891cff6 to your computer and use it in GitHub Desktop.
KeyedMapper segfault
import Foundation
public protocol JSONKey: RawRepresentable, Hashable {
var stringValue: String { get }
}
extension JSONKey where Self.RawValue == String {
public var stringValue: String {
return rawValue
}
}
import Foundation
public struct KeyedMapper<Object: Mappable> {
public let JSON: [AnyHashable : Any]
public init(JSON: [AnyHashable : Any], type: Object.Type) {
self.JSON = JSON
}
}
import Foundation
public protocol Mappable {
associatedtype Key: JSONKey
init(map: KeyedMapper<Self>) throws
}
@Noobish1
Copy link
Author

Noobish1 commented Nov 5, 2016

1.	While reading from /Users/Blair/Library/Developer/Xcode/DerivedData/KeyedMapperSegFault-cbmkkertbzqysabwirlimgurjxaj/Build/Intermediates/KeyedMapperSegFault.build/Debug-iphonesimulator/KeyedMapperSegFault.build/Objects-normal/x86_64/KeyedMapper~partial.swiftmodule
2.	While deserializing decl #3 (STRUCT_DECL)
3.	While deserializing 'Object' (GenericTypeParamDecl #1) 
4.	While deserializing decl #6 (XREF)
5.	Cross-reference to module 'KeyedMapperSegFault'
	... Mappable
	... Key
6.	While loading members for 'Mappable' at <invalid loc>
7.	While deserializing 'init' (ConstructorDecl #4) 
8.	While deserializing decl #8 (PARAM_DECL)
9.	While deserializing decl #9 (XREF)
10.	Cross-reference to module 'KeyedMapperSegFault'
	... KeyedMapper
11.	While reading from /Users/Blair/Library/Developer/Xcode/DerivedData/KeyedMapperSegFault-cbmkkertbzqysabwirlimgurjxaj/Build/Intermediates/KeyedMapperSegFault.build/Debug-iphonesimulator/KeyedMapperSegFault.build/Objects-normal/x86_64/KeyedMapper~partial.swiftmodule
12.	While deserializing decl #3 (STRUCT_DECL)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment