Closed
Description
Description
This code successfully compiles with the 2024-05-14 6.0 development snapshot in both Swift 5 and Swift 6 mode.
I'm fairly sure that Swift 5.10's error is correct and this code should be invalid.
Reproduction
@MainActor
func doThing(_ value: Int) {
}
class SomeThing {
let task = Task {
doThing(42)
}
}
Expected behavior
With swift 5.10:
swift -enable-experimental-feature StrictConcurrency test.swift
test.swift:7:3: error: expression is 'async' but is not marked with 'await'
doThing(42)
^~~~~~~~~~~
await
test.swift:7:3: note: calls to global function 'doThing' from outside of its actor context are implicitly asynchronous
doThing(42)
^
Environment
swift-6.0-DEVELOPMENT-SNAPSHOT-2024-05-14-a
Apple Swift version 6.0-dev (LLVM 5b202efbc95a8bf, Swift a17d360)
Target: arm64-apple-macosx14.0
Additional information
No response