The AttributedString is Sendable, but AttributedString.paragraphStyle is NSParagraphStyle, which is not Sendable, so this code in Swift 5.9 will give me this error:
var attributeString = AttributedString("")
attributeString.paragraphStyle = NSParagraphStyle() // Conformance of 'NSParagraphStyle' to 'Sendable' is unavailable
I raise a feedback since Xcode 15 b1, but it still happen in b6, it seems Apple doesn't care about this, so is there any solution to disable Sendable check to a setter?
You can use extension NSParagraphStyle: @unchecked Sendable {} in your code. Technically it may be unsafe due to NSParagraph style being a class with a mutable subclass but as long as you don't mutate it directly it should be fine.
The warning in Xcode says that NSParagraphStyle has been explicitly marked as not Sendable. To you're point I'm assuming it's only because of the mutable subclass, but it still seems sketchy to retroactively conform a type to Sendable that has explicitly marked itself as not Sendable.
Oddly enough, Xcode 15b8 doesn't produce that warning, despite the fact that it's still explicitly unavailable in the module definition. It seems to be effective since the warning about NSParagraphStyle not being Sendable goes away. This seems like a bug.