SR-4487 Crash when pattern matching two cases with associated values of protocol type
relates to:
SR-4417 Compiler crashes when get value from enum specific case.
Issue Description:
If a value type has a weak property, a switch statement that chains multiple case statements together, where those case statements each capture an instance of that type, will crash the Swift compiler with a segfault when attempting to emit SIL.
See the attached Playground and compare the two implementations of equality for TroubledEnum, but in short:
switchself {
case .a(letx): returnxcase .b(letx): returnx
}
works fine but
switchself {
case .a(letx), .b(letx): returnx
}
does not.
The text was updated successfully, but these errors were encountered:
Attachment: Download
Additional Detail from JIRA
md5: 42ecce32954c17632e7caea2dde28d5f
is duplicated by:
relates to:
Issue Description:
If a value type has a weak property, a switch statement that chains multiple case statements together, where those case statements each capture an instance of that type, will crash the Swift compiler with a segfault when attempting to emit SIL.
See the attached Playground and compare the two implementations of equality for TroubledEnum, but in short:
works fine but
does not.
The text was updated successfully, but these errors were encountered: