Crash with a keypath to a static variable with a nested container #81705
8000
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
When trying to access the key path of a static variable with a nested container (call the function
func flagValue<V>(of featureFlagPath: KeyPath<FeatureFlags.Type, FeatureFlag<V>>) -> V
with, for instance\.Category.nestedTest
; see later for a more complete example), the compiler crash with a segfault on macOS (Swift 6.1), and a fatal error (unknown kind of storage
) on Swift 6.2 on Linux.Reproduction
Try to compile or run this, the compiler crashes (tested with Swift 6.1 on macOS and Debian and Swift
6.2-snapshot-2025-05-15
on Debian):Stack dump
Expected behavior
The code should compile.
Environment
The stack trace comes from:
I also tested on Debian w/ Swift
6.2-snapshot-2025-05-15
.Additional information
No response
The text was updated successfully, but these errors were encountered: