[embedded] Improve the diagnostic message when using an existential

This commit is contained in:
Kuba Mracek
2023-10-09 16:20:08 -07:00
parent 44307996e3
commit d5b1abb726
5 changed files with 12 additions and 4 deletions

View File

@@ -13,6 +13,6 @@ 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}}
_ = type(of: x) // expected-error {{Existential type 'AnyObject' is unavailable in embedded Swift}}
// expected-note@-1 {{called from here}}
}