Skip to content

Commit 8117052

Browse files
committed
Sema: Tweak a diagnostic
We talk about 'protocol refinement' rather than 'protocol inheritance'; but in this case, a more specific phrase makes even more sense, I think.
1 parent e382459 commit 8117052

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2628,7 +2628,7 @@ WARNING(duplicate_anyobject_class_inheritance,none,
26282628
ERROR(inheritance_from_protocol_with_superclass,none,
26292629
"inheritance from class-constrained protocol composition type %0", (Type))
26302630
WARNING(anyobject_class_inheritance_deprecated,none,
2631-
"using 'class' keyword for protocol inheritance is deprecated; "
2631+
"using 'class' keyword to define a class-constrained protocol is deprecated; "
26322632
"use 'AnyObject' instead", ())
26332633
ERROR(multiple_inheritance,none,
26342634
"multiple inheritance from classes %0 and %1", (Type, Type))
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// RUN: %target-typecheck-verify-swift -swift-version 5
22

33
protocol P: class {}
4-
// expected-warning@-1 {{using 'class' keyword for protocol inheritance is deprecated; use 'AnyObject' instead}} {{13-18=AnyObject}}
4+
// expected-warning@-1 {{using 'class' keyword to define a class-constrained protocol is deprecated; use 'AnyObject' instead}} {{13-18=AnyObject}}
55
protocol P1: AnyObject {}
66
protocol P2 {}
77
protocol P3: class, P2 {}
8-
// expected-warning@-1 {{using 'class' keyword for protocol inheritance is deprecated; use 'AnyObject' instead}} {{14-19=AnyObject}}
8+
// expected-warning@-1 {{using 'class' keyword to define a class-constrained protocol is deprecated; use 'AnyObject' instead}} {{14-19=AnyObject}}
99
protocol P4: P2, class {} // expected-error {{'class' must come first in the requirement list}}
10-
// expected-warning@-1 {{using 'class' keyword for protocol inheritance is deprecated; use 'AnyObject' instead}} {{18-23=AnyObject}}
10+
// expected-warning@-1 {{using 'class' keyword to define a class-constrained protocol is deprecated; use 'AnyObject' instead}} {{18-23=AnyObject}}

0 commit comments

Comments
 (0)