You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I stumbled upon this issue while trying to enhance an API that provides both a method that accepts a variadic input, as well as an array, as a convenience. The overloads prevents the user from using the shorthand notation, ruining SE-0299 benefits.
See in the sample code below four examples, two successes, and two unexpected compiler errors:
// ======// SE-0299 setupprotocolP { }
structS: P { }
extensionPwhereSelf == S {
staticvars: Self { S() }
}
// ======// SE-0299 successesfuncf1(_p: P) { }
f1(.s) // OKfuncf2(_ps: P...) { }
f2(.s) // OK// ======// SE-0299 failuresfuncf3(_ps: P...) { }
funcf3(_ps: [P]) { }
f3(.s) // error: Type '[P]' has no member 's'funcf4(_p: P) { }
funcf4(_int: Int) { }
f4(.s) // error: Type 'Int' has no member 's'
The text was updated successfully, but these errors were encountered:
Environment
Xcode 13.0 (13A233)
Additional Detail from JIRA
md5: a9cb4639075680dd9ff53f7f9c8b37e4
Issue Description:
Hello,
The Swift 5.5 compiler won't accept the shorthand notation
.staticMember
for existential values, as described by SE-0299 Extending Static Member Lookup in Generic Contexts, when there exist an overload that accepts another input.I stumbled upon this issue while trying to enhance an API that provides both a method that accepts a variadic input, as well as an array, as a convenience. The overloads prevents the user from using the shorthand notation, ruining SE-0299 benefits.
See in the sample code below four examples, two successes, and two unexpected compiler errors:
The text was updated successfully, but these errors were encountered: