Compiler crash for self
reference in enum with no cases
#66384
Labels
assertion failure
Bug → crash: An assertion failure
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler itself
crash
Bug: A crash, i.e., an abnormal termination of software
declarations
Feature: declarations
enum
Feature → type declarations: Swift enumeration declarations
expressions
Feature: expressions
self
Feature → expressions: The 'self' expression
SILGen
Area → compiler: The SIL generation stage
statements
Feature: statements
swift 5.9
switch
Feature → statements: 'switch' statements
Description
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
The text was updated successfully, but these errors were encountered: