[SR-7921] Inconsistent ability to append sequences of non-optional E to those of optional E? #50456
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
standard library
Area: Standard library umbrella
type checker
Area → compiler: Semantic analysis
Environment
Swift 4.2 snapshot
Additional Detail from JIRA
md5: 452b965635b75a8ef058d4b29a3d8c0f
Issue Description:
The following code fails to compile:
with the error:
However, if I use regular
Array
this problem does not occur. This code compiles:It seems that there is an escape hatch for appending the contents of
Array<E>
toSequence<E?>
, but not a more general one. That seems weirdly inconsistent.The text was updated successfully, but these errors were encountered: