[SR-11517] Compiler crash in Xcode 11 with struct containing tuple of optionals #53918
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
regression
swift 5.1
Environment
Xcode 11.0 (11A420a)
Swift toolchain bundled with Xcode 11
macOS Mojave 10.14.5 (18F203)
Additional Detail from JIRA
md5: 07df1ca2e9800f95151b84a0aa1c3b67
Issue Description:
In Xcode 11, the Swift compiler crashes with a segmentation fault when I try to compile the following struct:
Some observations:
Adding an explicit initializer to the struct resolves the issue, so this might have something to do with SE-0242
Adding an explicit default value to the tuple resolves the issue:
var badTuple: (Int?, Int?) = (nil, nil)
The enclosing type has to be a struct—classes don’t have the same issue, and neither do tuple values in the global scope
The tuple has to be a
var
property, not alet
oneThe types and quantity of the values in the tuple do not seem to matter, as long as they are all optional
The struct has to be built by Xcode 11 in an Xcode project—Xcode 10, Playgrounds, and the Swift CLI does not have the issue, but Xcode projects created by Xcode or generated with
swift package generate-xcodeproj
doThis is the segmentation fault error message:
The text was updated successfully, but these errors were encountered: