Open sisoje opened 1 month ago
We should have consistent behavior across swift versions
Swift 6 is a new major versions. Breaking changes are expected and allowed per SemVer 2.0. A big point of Swift "6" is to be able to release some breaking changes, otherwise there was nothing wrong with the next Swift version being "5.11".
I'm not even sure if string representation of types is considered part of the API (probably not). I can still imagine that the Swift team doesn't want to annoy users by changing descriptions all the time even if they are not considered breaking. But since this is a new major version, such a small change should be fine even after those considerations.
Basically I can not cast a runtime object to @MainActor ()->() because compiler prevents me by converting it to @MainActor @Sendable ()->() and casting fails. That is an issue. Is it a bug with casting?
Description
When printing type info of
@MainActor () -> Void
, then,@Sendable
is added inside type description when executed in swift 6.Reproduction
Expected behavior
'@Sendable' should not be added to the description.
We should have consistent behavior across swift versions, type descriptions should be same in both swift 6 and swift 5.10
Environment
On swift 6.0 its a bug On swift 5.10 works ok
Additional information
No response