Files
swift-mirror/test/embedded/anyobject-error-no-stdlib.swift
T
Doug Gregor 46389f7d7e [Embedded] Start allowing metatypes in Embedded Swift
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.
2026-04-27 14:02:03 -07:00

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)
}