Compiler crash with strict concurrency and referring to another @MainActor class #72285
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
crash
Bug: A crash, i.e., an abnormal termination of software
triage needed
This issue needs more specific labels
Description
The code snippet has a class that constructs another class, which constructs another class in its initializer. These are all classes annotated with
@MainActor
.Changing things about the last object in the chain can prevent the crash.
Reproduction
This crashes with
swiftc -strict-concurrency=complete
Stack dump
Expected behavior
It should not crash. The code looks reasonable to me.
Environment
swift-driver version: 1.90.11.1 Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
Target: arm64-apple-macosx14.0
Additional information
Without
-strict-concurrency=complete
, the compiler reports an error:The text was updated successfully, but these errors were encountered: