Skip to content

Commit bbe111c

Browse files
committed
[embedded] Update wording on 'no existentials' diagnostic
1 parent d5b1abb commit bbe111c

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

include/swift/AST/DiagnosticsSIL.def

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,9 +353,9 @@ ERROR(global_must_be_compile_time_const,none,
353353
ERROR(non_final_generic_class_function,none,
354354
"classes cannot have non-final generic fuctions in embedded Swift", ())
355355
ERROR(embedded_swift_existential_type,none,
356-
"Existential type %0 is unavailable in embedded Swift", (Type))
356+
"using values of protocol type %0 is not allowed in embedded Swift", (Type))
357357
ERROR(embedded_swift_existential,none,
358-
"Existentials are unavailable in embedded Swift", ())
358+
"using values of protocol types is not allowed in embedded Swift", ())
359359
NOTE(performance_called_from,none,
360360
"called from here", ())
361361

test/embedded/anyobject-error-no-stdlib.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ public typealias AnyObject = Builtin.AnyObject
1313
precedencegroup AssignmentPrecedence { assignment: true }
1414

1515
public func foo(_ x: AnyObject) {
16-
_ = type(of: x) // expected-error {{Existential type 'AnyObject' is unavailable in embedded Swift}}
16+
_ = type(of: x) // expected-error {{using values of protocol type 'AnyObject' is not allowed in embedded Swift}}
1717
// expected-note@-1 {{called from here}}
1818
}

test/embedded/basic-errors-no-stdlib.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ public protocol Player {}
44
struct Concrete: Player {}
55

66
public func test() -> any Player {
7-
Concrete() // expected-error {{Existential type 'any Player' is unavailable in embedded Swift}}
7+
Concrete() // expected-error {{using values of protocol type 'any Player' is not allowed in embedded Swift}}
88
// expected-note@-1 {{called from here}}
99
}

test/embedded/throw-trap.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public func catching1() {
2323
}
2424
}
2525

26-
// CHECK-EXISTENTIALS: error: Existential type 'any Error' is unavailable in embedded Swift
26+
// CHECK-EXISTENTIALS: error: using values of protocol type 'any Error' is not allowed in embedded Swift
2727

2828
// CHECK-TRAPS-SIL: sil @$s4main9throwing1SiyKF : $@convention(thin) () -> (Int, @error any Error) {
2929
// CHECK-TRAPS-SIL-NEXT: bb0:

0 commit comments

Comments
 (0)