Implicit optional promotion of variadic tuple assertion failure: !tupleTy.containsPackExpansionType()
#78814
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
crash
Bug: A crash, i.e., an abnormal termination of software
triage needed
This issue needs more specific labels
Description
In one version of my code base, the compiler crashes when it should use implicit optional promotion of a tuple with variadic members. I can work around the issue by explicitly putting the variadic tuple in a
.some(...)
optional case.Reproduction
I haven't been able to reproduce the crash in a reduced codebase, but I have a branch that exhibits the behavior with a single parameter uncommented:
https://github.com/apple/swift-argument-parser/blob/option-tuples/Sources/ArgumentParser/Parsable%20Properties/Option.swift#L957-L960
The problem is a call from within one initializer to another, where both have the same generic parameters and constraints, but the callee's first parameter is an optional.
The callee is defined here:
https://github.com/apple/swift-argument-parser/blob/option-tuples/Sources/ArgumentParser/Parsable%20Properties/Option.swift#L868-L878
If the variadic tuple value is passed as an explicit optional case value (
.some(wrappedValue)
), there's no compiler crash.Stack dump
Expected behavior
Successful compilation of the initializer.
Environment
Apple Swift version 6.2-dev (LLVM 81859ac55f8d09a, Swift 8ec8a12)
Target: arm64-apple-macosx15.0
Additional information
No response
The text was updated successfully, but these errors were encountered: