Conformance to RawRepresentable prevents static members from being initialized #81575
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
triage needed
This issue needs more specific labels
Description
I have a short piece of code here that works perfectly when it doesn't conform to RawRepresentable. However, if it conforms to RawRepresentable, it crashes with EXC_BREAKPOINT when accessing the static member dictionary (when
.rawValue
is called). Basically seems like the static member is never getting initialized.I tested this in the swift playground.
Reproduction
Expected behavior
The program should print
blue = helloworld
and not crashEnvironment
swift-driver version: 1.120.5 Apple Swift version 6.1 (swiftlang-6.1.0.110.21 clang-1700.0.13.3)
Target: arm64-apple-macosx15.0
Additional information
No response
The text was updated successfully, but these errors were encountered: