This is a bug in Swift. Until it's fixed you can work around it by changing import Foundation to @preconcurrency import Foundation.
See this Swift forum thread.
Topic:
Programming Languages
SubTopic:
Swift
Tags: