Closed
Description
The following code produces Type of expression is ambiguous without more context
func configure<T, each Element>(
_ item: T,
with configuration: repeat (ReferenceWritableKeyPath<T, each Element>, each Element)
) -> T {
repeat item[keyPath: (each configuration).0] = (each configuration).1 // error: Type of expression is ambiguous without more context
return item
}
This should compile successfully.
Metadata
Metadata
Assignees
Labels
A deviation from expected or documented behavior. Also: expected but undesirable behavior.The Swift compiler itselfFeature: expressionsFeature: generic declarations and typesFeature: key paths (both native and Objective-C)Feature → generics: Parameter packsFeature: tuplesArea → compiler: Semantic analysisBug: Unexpected error