This is now fixed in the new versions of Swift: https://github.com/swiftlang/swift/pull/80220/files
If you are using older versions of the compiler, see rob mayoff's excellent workaround.