-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Open
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.parameter packsFeature → generics: Parameter packsFeature → generics: Parameter packstriage neededThis issue needs more specific labelsThis issue needs more specific labels
Description
Description
In a parameter pack context, generic static member lookup fails to type check an expressible by literal value.
Reproduction
This demonstrates the issue, but replacing I
for any other literal, like integers or string interpolation, fails in similar ways.
protocol P<T> {
associatedtype T
}
struct S<T>: P {}
struct I: ExpressibleByStringLiteral {
init(stringLiteral value: String) {}
}
extension P {
static func f<T>(_ i: I, as: T.Type) -> Self where Self == S<T> {
Self()
}
}
func f<each T: P>(_: () -> (repeat each T)) {
}
func g() {
f { (.f("", as: Int.self), .f("", as: Int.self)) }
// error: Cannot convert value of type 'String' to expected argument type 'I'
}
Expected behavior
I expect .f
's first literal string value to go through the associated I
's expressible by string literal conformance.
Environment
swift-driver version: 1.115.1 Apple Swift version 6.0.3 (swiftlang-6.0.3.1.10 clang-1600.0.30.1)
Target: arm64-apple-macosx15.0
Additional information
No response
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.parameter packsFeature → generics: Parameter packsFeature → generics: Parameter packstriage neededThis issue needs more specific labelsThis issue needs more specific labels