I think this is related to issue #38 but after updating to 1.1.1 I still get a crash.
Same cause, when accessing deviceType.
We're trying to use Xcode 9.3 and Carthage 0.27.0
After pulling upstream in to duckduckgo/iOS I updated Carthage to point at 1.1.1 and cleared my Carthage cache under ~/Library and the built binaries it creates relative to the project.
I've attached a sample project that demonstrates the problem. Run the app and tap "CRASH ME". It simply calls an action which tries to print the current device type to the console:
print(UIDevice.current.deviceType)
Thread 1 Queue : com.apple.main-thread (serial)
#0 0x000000010b22388f in DeviceType.hashValue.getter ()
#1 0x000000010b223ebf in protocol witness for Hashable.hashValue.getter in conformance DeviceType [inlined] ()
#2 0x000000010b223eb6 in specialized closure #1 in closure #1 in static CaseIterable<>.allCases.getter at /Users/brindy/Projects/Personal/CrashSample/Carthage/Checkouts/Device.swift/Device/UIDeviceExtension.swift:235
#3 0x000000010b2263b1 in specialized closure #1 in closure #1 in static CaseIterable<>.allCases.getter [inlined] ()
#4 0x000000010b2263a9 in partial apply for specialized ()
#5 0x000000010e4427b5 in _ClosureBasedIterator.next() ()
#6 0x000000010e442801 in protocol witness for IteratorProtocol.next() in conformance _ClosureBasedIterator<A> ()
#7 0x000000010e44296d in _IteratorBox.next() ()
#8 0x000000010b2242ae in specialized AnyIterator.next() [inlined] ()
#9 0x000000010b224296 in specialized protocol witness for IteratorProtocol.next() in conformance AnyIterator<A> [inlined] ()
#10 0x000000010b224296 in specialized _copySequenceToContiguousArray<A>(_:) ()
#11 0x000000010b225811 in specialized Sequence._copyToContiguousArray() [inlined] ()
#12 0x000000010b225803 in specialized protocol witness for Sequence._copyToContiguousArray() in conformance _ClosureBasedSequence<A> [inlined] ()
#13 0x000000010b225803 in specialized _SequenceBox.__copyToContiguousArray() [inlined] ()
#14 0x000000010b225803 in specialized AnySequence._copyToContiguousArray() [inlined] ()
#15 0x000000010b225803 in specialized protocol witness for Sequence._copyToContiguousArray() in conformance AnySequence<A> [inlined] ()
#16 0x000000010b225803 in specialized Array.init<A>(_:) [inlined] ()
#17 0x000000010b225803 in specialized static CaseIterable<>.allCases.getter [inlined] at /Users/brindy/Projects/Personal/CrashSample/Carthage/Checkouts/Device.swift/Device/UIDeviceExtension.swift:231
#18 0x000000010b225803 in specialized DeviceType.init(identifier:) [inlined] at /Users/brindy/Projects/Personal/CrashSample/Carthage/Checkouts/Device.swift/Device/UIDeviceExtension.swift:197
#19 0x000000010b225803 in DeviceType.init(identifier:) [inlined] at /Users/brindy/Projects/Personal/CrashSample/Carthage/Checkouts/Device.swift/Device/UIDeviceExtension.swift:195
#20 0x000000010b225803 in specialized static DeviceType.current.getter at /Users/brindy/Projects/Personal/CrashSample/Carthage/Checkouts/Device.swift/Device/UIDeviceExtension.swift:90
#21 0x000000010b223e80 in static DeviceType.current.getter [inlined] ()
#22 0x000000010b223e7b in UIDevice.deviceType.getter at /Users/brindy/Projects/Personal/CrashSample/Carthage/Checkouts/Device.swift/Device/UIDeviceExtension.swift:215
#23 0x000000010af3aad5 in ViewController.crashMe() at /Users/brindy/Projects/Personal/CrashSample/CrashSample/ViewController.swift:26
#24 0x000000010af3ab74 in @objc ViewController.crashMe() ()
#25 0x000000010c102448 in -[UIApplication sendAction:to:from:forEvent:] ()
#26 0x000000010c27d804 in -[UIControl sendAction:to:forEvent:] ()
#27 0x000000010c27db21 in -[UIControl _sendActionsForEvents:withEvent:] ()
#28 0x000000010c27ca69 in -[UIControl touchesEnded:withEvent:] ()
#29 0x000000010c17711f in -[UIWindow _sendTouchesForEvent:] ()
#30 0x000000010c178821 in -[UIWindow sendEvent:] ()
#31 0x000000010c11c370 in -[UIApplication sendEvent:] ()
#32 0x000000010ca5d57f in __dispatchPreprocessedEventFromEventQueue ()
#33 0x000000010ca60194 in __handleEventQueueInternal ()
#34 0x000000010ed44bb1 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ ()
#35 0x000000010ed294af in __CFRunLoopDoSources0 ()
#36 0x000000010ed28a6f in __CFRunLoopRun ()
#37 0x000000010ed2830b in CFRunLoopRunSpecific ()
#38 0x000000011456ba73 in GSEventRunModal ()
#39 0x000000010c1010b7 in UIApplicationMain ()
#40 0x000000010af3bdf7 in main at /Users/brindy/Projects/Personal/CrashSample/CrashSample/AppDelegate.swift:12
#41 0x000000011063b955 in start ()
Hopefully it's something, I've done. Apologies in advance if it is.
If not, let me know if there's anything I can help to debug/fix.
Thanks in a advance!
CrashSample.zip
bug