[Concurrency] add fixit to add final to non-sendable class -> Sendable

The previous message was just suggesting unchecked Sendable, but instead
we should be suggesting to add final to the class. We also don't
outright suggest using unchecked Sendable -- following
https://github.com/swiftlang/swift/pull/81738 precedent.

Resolves rdar://155790695
This commit is contained in:
Konrad 'ktoso' Malawski
2025-07-15 09:16:48 +09:00
parent 49e4a9fdfa
commit f52f445358
10 changed files with 17 additions and 18 deletions

View File

@@ -5954,8 +5954,7 @@ ERROR(concurrent_value_outside_source_file,none,
"%kind0; use '@unchecked Sendable' for retroactive conformance",
(const ValueDecl *))
ERROR(concurrent_value_nonfinal_class,none,
"non-final class %0 cannot conform to 'Sendable'; "
"use '@unchecked Sendable'", (DeclName))
"non-final class %0 can not conform to the 'Sendable' protocol", (DeclName))
ERROR(concurrent_value_inherit,none,
"'Sendable' class %1 cannot inherit from another class"
"%select{| other than 'NSObject'}0",