[SR-6908] Unable to infer heterogenous Array type when concatenating Arrays #49457
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
type checker
Area → compiler: Semantic analysis
Attachment: Download
Environment
Swift version 4.0.3 (swiftlang-900.0.74.1 clang-900.0.39.2)
Swift version 4.1 (swiftlang-902.0.34 clang-902.0.30)
Additional Detail from JIRA
md5: 81871d183f8c2fdb991c92349182ba21
Issue Description:
Consider this hierarchy:
This works:
However, let's create an array of `C`s:
I can create an Array of `A`s by explicitly declaring the type:
However, without the explicit type, it's unable to infer it:
Producing one okay-diagnostic, and a diagnostic that makes no sense:
Note that the second diagnostic is not because of the similarity of the class names, I get the same in my project:
The text was updated successfully, but these errors were encountered: