mirror of
https://github.com/apple/swift.git
synced 2026-06-20 15:42:51 +02:00
46389f7d7e
Now that we have generalized existentials in Embedded Swift, we also have all of the infrastructure for metatypes. They're lazily constructed on an as-needed basis, but otherwise work the same way as in non-Embedded Swift. Fixes rdar://145706221.
21 lines
501 B
Swift
21 lines
501 B
Swift
// RUN: %target-swift-emit-ir -parse-stdlib %s -enable-experimental-feature Embedded -verify -wmo
|
|
|
|
// REQUIRES: swift_in_compiler
|
|
// REQUIRES: swift_feature_Embedded
|
|
|
|
public enum Never {}
|
|
|
|
@_silgen_name("abort")
|
|
func abort() -> Never
|
|
|
|
@_semantics("typechecker.type(of:)")
|
|
public func type<T, Metatype>(of value: T) -> Metatype { abort() }
|
|
|
|
public typealias AnyObject = Builtin.AnyObject
|
|
|
|
precedencegroup AssignmentPrecedence { assignment: true }
|
|
|
|
public func foo(_ x: AnyObject) {
|
|
_ = type(of: x)
|
|
}
|