Skip to content

Commit 212ffad

Browse files
committed
Improve diagnostic for Error compositions not being representable in Objective-C.
Thanks, Jordan!
1 parent 6575877 commit 212ffad

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2751,7 +2751,8 @@ NOTE(not_objc_empty_protocol_composition,none,
27512751
NOTE(not_objc_protocol,none,
27522752
"protocol %0 is not '@objc'", (Type))
27532753
NOTE(not_objc_error_protocol_composition,none,
2754-
"protocol composition involving 'Error' is not '@objc'", ())
2754+
"protocol composition involving 'Error' cannot be represented "
2755+
"in Objective-C", ())
27552756
NOTE(not_objc_empty_tuple,none,
27562757
"empty tuple type cannot be represented in Objective-C", ())
27572758
NOTE(not_objc_tuple,none,

test/attr/attr_objc.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1943,7 +1943,7 @@ class ClassThrows1 {
19431943

19441944
@objc func fooWithErrorProtocolComposition1(x: Error & Protocol_ObjC1) { }
19451945
// expected-error@-1{{method cannot be marked @objc because the type of the parameter cannot be represented in Objective-C}}
1946-
// expected-note@-2{{protocol composition involving 'Error' is not '@objc'}}
1946+
// expected-note@-2{{protocol composition involving 'Error' cannot be represented in Objective-C}}
19471947

19481948
// CHECK: {{^}} func fooWithErrorProtocolComposition2(x: Error & Protocol_ObjC1)
19491949
func fooWithErrorProtocolComposition2(x: Error & Protocol_ObjC1) { }

0 commit comments

Comments
 (0)