mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
19 lines
544 B
Swift
19 lines
544 B
Swift
// RUN: %target-swift-emit-ir -parse-stdlib %s -enable-experimental-feature Embedded -verify
|
|
|
|
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) // expected-error {{existential can cause metadata allocation or locks}}
|
|
// expected-note@-1 {{called from here}}
|
|
}
|