Skip to content

Commit 6d9aa9b

Browse files
committed
Foundation: workaround the frontend trying to keep sugar
The compiler is working hard to keep the type sugar on the interface for even an internal interface. The type sugar being preserved causes a deserialization failure on Darwin. Use an equivalent local typealias to avoid the issue.
1 parent 6505a28 commit 6d9aa9b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Foundation/Thread.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@
99

1010
import CoreFoundation
1111

12+
// WORKAROUND_SR????
13+
#if os(Windows)
14+
typealias _swift_CFThreadRef = HANDLE
15+
#else
16+
typealias _swift_CFThreadRef = pthread_t
17+
#endif
18+
1219
internal class NSThreadSpecific<T: NSObject> {
1320
private var key = _CFThreadSpecificKeyCreate()
1421

@@ -194,7 +201,7 @@ open class Thread : NSObject {
194201

195202
open private(set) var threadDictionary: NSMutableDictionary = NSMutableDictionary()
196203

197-
internal init(thread: _CFThreadRef) {
204+
internal init(thread: _swift_CFThreadRef) {
198205
// Note: even on Darwin this is a non-optional _CFThreadRef; this is only used for valid threads, which are never null pointers.
199206
_thread = thread
200207
}

0 commit comments

Comments
 (0)