Open
Description
Description
import Foundation
enum MySwitch {
public var generatedExperimentKey: String {
switch self {
default: fatalError()
}
//return ""
}
}
Steps to reproduce
Save the code above to file. Run swiftc someFile.swift
.
Note: Uncomment the return to fix the crash. It produces a "will never reach" warning, but also a "note: 'self' is of type 'MySwitch' which cannot be constructed because it is an enum with no cases"
Expected behavior
Compiler should not crash.
Swift 5.9 (swiftlang-5.9.0.114.6 clang-1500.0.27.1)
Xcode 15.0 Build version 15A5160n
Metadata
Metadata
Assignees
Labels
Area → compiler: The SIL generation stageBug → crash: An assertion failureA deviation from expected or documented behavior. Also: expected but undesirable behavior.The Swift compiler itselfBug: A crash, i.e., an abnormal termination of softwareFeature: declarationsFeature → type declarations: Swift enumeration declarationsFeature: expressionsFeature → expressions: The 'self' expressionFeature: statementsFeature → statements: 'switch' statements