MainActor に戻す手段をどこかで見たなぁと思って WWDC のセッションや Proposal 漁ってたんですが、 { @MainActor in ... } を見つけて、これだったかも?ってなってました。T.self をデフォルトにするのおもしろいですね。 JSONDecoder.decode とかもこれやってほしいかも。 static func run<T>(resultType: T.Type = T.self, body: @MainActor @Sendable () throws -> T) async rethrows -> Timport Foundation extension JSONDecoder { func myDecode<T: Decodable>(_ type: T.Type = T.self, from data: Data) throws -> T { try decode(type, from: data) } } let decoded: [Int] = try! JSONDecoder().myDecode(from: "[2, 3, 5]".data(using: .utf8)!) print(decoded)