-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfexpressionsFeature: expressionsFeature: expressionsgenericsFeature: generic declarations and typesFeature: generic declarations and typeskey pathsFeature: key paths (both native and Objective-C)Feature: key paths (both native and Objective-C)parameter packsFeature → generics: Parameter packsFeature → generics: Parameter packsswift 5.9tuplesFeature: tuplesFeature: tuplestype checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysisunexpected errorBug: Unexpected errorBug: Unexpected error
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.
IanKeen, Pretz, daltonclaybrook and tevelee
Metadata
Metadata
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfexpressionsFeature: expressionsFeature: expressionsgenericsFeature: generic declarations and typesFeature: generic declarations and typeskey pathsFeature: key paths (both native and Objective-C)Feature: key paths (both native and Objective-C)parameter packsFeature → generics: Parameter packsFeature → generics: Parameter packsswift 5.9tuplesFeature: tuplesFeature: tuplestype checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysisunexpected errorBug: Unexpected errorBug: Unexpected error