[SR-15324] Function with default value after guard statement triggers captureInfo.hasBeenComputed() assertion failure #57646
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 in itself
crash
Bug: A crash, i.e., an abnormal termination of software
default arguments
Feature: default arguments for value parameters
SILGen
Area → compiler: The SIL generation stage
statements
Feature: statements
swift 6.0
Additional Detail from JIRA
md5: 3834635bf2a835289c6dc1d000ee51a7
Issue Description:
At some point after the 2021-09-09 nightly snapshot and before the 2021-09-14 nightly (I haven't yet isolated it further), the following single-file example started triggering a captureInfo.hasBeenComputed() assertion failure in TypeLowering.cpp when building with debug symbols:
To reproduce, place the above in a single file and run `swiftc -g file.swift`. Building without debug symbols will not trigger the assertion. Either removing the default value for the exitCode argument or removing the guard statement prevents the assertion from failing.
The full text of the assertion failure is as follows:
The text was updated successfully, but these errors were encountered: