Skip to content

Commit 463f355

Browse files
committed
[stdlib] ObjectIdentifier: Work around issue with generalized existentials
1 parent d6bf934 commit 463f355

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

stdlib/public/core/ObjectIdentifier.swift

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,17 @@ public struct ObjectIdentifier: Sendable {
6666
self._value = unsafe unsafeBitCast(x, to: Builtin.RawPointer.self)
6767
}
6868

69+
/// Creates an instance that uniquely identifies the given metatype.
70+
///
71+
/// - Parameters:
72+
/// - x: A metatype.
6973
@_alwaysEmitIntoClient
70-
public init(_ x: any (~Copyable & ~Escapable).Type) {
74+
@_disfavoredOverload
75+
public init<T: ~Copyable & ~Escapable>(_ x: T.Type) {
76+
// FIXME: This should rather use an existential:
77+
// FIXME: init(_ x: any (~Copyable & ~Escapable).Type)
78+
// FIXME: Unfortunately, that syntax does not survive into the
79+
// FIXME: swiftinterface. rdar://139465298
7180
self._value = unsafeBitCast(x, to: Builtin.RawPointer.self)
7281
}
7382
}

0 commit comments

Comments
 (0)