@@ -158,7 +158,6 @@ internal func != (lhs: Builtin.RawPointer, rhs: Builtin.RawPointer) -> Bool {
158
158
return !( lhs == rhs)
159
159
}
160
160
161
- #if !$Embedded
162
161
/// Returns a Boolean value indicating whether two types are identical.
163
162
///
164
163
/// - Parameters:
@@ -176,11 +175,7 @@ public func == (
176
175
case ( . none, . none) :
177
176
return true
178
177
case let ( . some( ty0) , . some( ty1) ) :
179
- // FIXME: this should read `Bool(Builtin.is_same_metatype(ty0, ty1))`,
180
- // but that currently requires copyability/escapability (rdar://145707064)
181
- let p1 = unsafeBitCast ( ty0, to: UnsafeRawPointer . self)
182
- let p2 = unsafeBitCast ( ty1, to: UnsafeRawPointer . self)
183
- return p1 == p2
178
+ return Bool ( Builtin . is_same_metatype ( ty0, ty1) )
184
179
default :
185
180
return false
186
181
}
@@ -202,6 +197,9 @@ public func != (
202
197
!( t0 == t1)
203
198
}
204
199
200
+ #if !$Embedded
201
+ // Embedded Swift is unhappy about conversions from `Any.Type` to
202
+ // `any (~Copyable & ~Escapable).Type` (rdar://145706221)
205
203
@usableFromInline
206
204
@_spi ( SwiftStdlibLegacyABI) @available ( swift, obsoleted: 1 )
207
205
internal func == ( t0: Any . Type ? , t1: Any . Type ? ) -> Bool {
@@ -218,37 +216,6 @@ internal func == (t0: Any.Type?, t1: Any.Type?) -> Bool {
218
216
internal func != ( t0: Any . Type ? , t1: Any . Type ? ) -> Bool {
219
217
!( t0 == t1)
220
218
}
221
- #else
222
- // FIXME: $Embedded doesn't grok `any (~Copyable & Escapable).Type` yet (rdar://145706221)
223
-
224
- /// Returns a Boolean value indicating whether two types are identical.
225
- ///
226
- /// - Parameters:
227
- /// - t0: A type to compare.
228
- /// - t1: Another type to compare.
229
- /// - Returns: `true` if both `t0` and `t1` are `nil` or if they represent the
230
- /// same type; otherwise, `false`.
231
- @inlinable @_transparent
232
- public func == ( t0: Any . Type ? , t1: Any . Type ? ) -> Bool {
233
- switch ( t0, t1) {
234
- case ( . none, . none) : return true
235
- case let ( . some( ty0) , . some( ty1) ) :
236
- return Bool ( Builtin . is_same_metatype ( ty0, ty1) )
237
- default : return false
238
- }
239
- }
240
-
241
- /// Returns a Boolean value indicating whether two types are not identical.
242
- ///
243
- /// - Parameters:
244
- /// - t0: A type to compare.
245
- /// - t1: Another type to compare.
246
- /// - Returns: `true` if one, but not both, of `t0` and `t1` are `nil`, or if
247
- /// they represent different types; otherwise, `false`.
248
- @inlinable @_transparent
249
- public func != ( t0: Any . Type ? , t1: Any . Type ? ) -> Bool {
250
- return !( t0 == t1)
251
- }
252
219
#endif
253
220
254
221
/// Tell the optimizer that this code is unreachable if condition is
0 commit comments