[SR-4256] Chaining ‘dropFirst' Calls on Array is Ambiguous #46839
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
Apple Swift version 3.0.2 (swiftlang-800.0.63 clang-800.0.42.1)
Target: x86_64-apple-macosx10.9
Additional Detail from JIRA
md5: a89bf93bffd383ea145cfdd12007284b
Issue Description:
Straight out of Sequence.swift, from comment for optimization to avoid multiple wrappers when chaining
dropFirst
calls:produces following error:
Workaround is to split the expression in two, storing first part in variable as seen in the tests for that method:
Given that we are just storing subexpressions in variables, without having to explicitly define types, this is a bug in compiler, which should be able to infer the most specific type - Collection in this case.
The text was updated successfully, but these errors were encountered: