[SR-10062] Providing default value for inout parameter leads to compiler crash #52464
Labels
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
function parameters
Feature → declarations: function parameters
inout
Feature → types: `inout` types
regression
SILGen
Area → compiler: The SIL generation stage
swift 5.0
types
Feature: types
Environment
swift --version:
Xcode Version 10.2 beta 4 (10P107d)
Additional Detail from JIRA
md5: d348d3279200779d6fecde1effa5849a
is duplicated by:
Issue Description:
If a default value is provided for an inout parameter, the compiler crashes when the function is called with no value provided.
The crash can be reproduced with the following example:
The code should probably give a syntax error, as an immutable value is passed as an inout parameter.
The following crash dump has been observed when compiling the above example with swiftc
The text was updated successfully, but these errors were encountered: