Open mattmassicotte opened 3 months ago
Things look different with swift-6.0-DEVELOPMENT-SNAPSHOT-2024-08-06-a
Apple Swift version 6.0-dev (LLVM 31f0cdc6d5ff8a6, Swift 497b266c2188eae)
Target: arm64-apple-macosx14.0
test.swift:6:6: error: main actor-isolated default value in a nonisolated context
4 |
5 | class SomeThing {
6 | let task = Task {
| `- error: main actor-isolated default value in a nonisolated context
7 | doThing(42)
8 | }
If I now add the await
, the error does not go away! Instead Instead I get the same error with warning that the await
is not necessary...
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
Expected behavior
With swift 5.10:
Environment
swift-6.0-DEVELOPMENT-SNAPSHOT-2024-05-14-a
Apple Swift version 6.0-dev (LLVM 5b202efbc95a8bf, Swift a17d360d1cc66ab) Target: arm64-apple-macosx14.0
Additional information
No response