Swift 5.4 released!

Swift 5.4 has been released:

Thank you to everyone in the community who contributed in large and small ways to bring this release together!

38 Likes

Great news, but I have a question. Xcode release notes still have this known issue in them, however IIRC a fix for this was cherry picked into 5.4 long time ago. So what's the deal now?

The compiler may generate incorrect code when you use an enum case with associated values to satisfy a protocol requirement. (72302307) For example:

protocol FileHandlerAction {  
  static func setFileURL(_ fileURL: NSURL) -> Self
}
enum AppAction : FileHandlerAction {  
  case setFileURL(NSURL )
}

Workaround : Provide a static method to satisfy the requirement:

enum AppAction : FileHandlerAction {  
  case _setFileURL(NSURL)
  static func setFileURL(_ fileURL: NSURL) -> Self { 
    return ._setFileURL(fileURL)  
  }
}

cc @Joe_Groff

1 Like

When debugging Swift code on Apple platforms, variables with resilient types (including Foundation value types such as URL , URLComponents , Notification , IndexPath , Decimal , Data , Date , Global , Measurement , and UUID ) are displayed in the Xcode variable view and the frame variable / v command again.

Been waiting for this.

2 Likes

This was a clerical error in the release notes. The issues has indeed been fixed in 5.4.

3 Likes
Terms of Service

Privacy Policy

Cookie Policy