Consider the following code:
extension String {
static let foo = NSLocalizedString("Foo", "Some localized string")
// This requires a named parameter nowadays:
// static let foo = NSLocalizedString("Foo", comment:"Some localized string")
// That is how it is defined in SBL in Foundation_Extension.swift,
// but for some reason it doesn't work.
}
func stringFunc(_ string: String) {
print(string)
}
stringFunc(.foo) // E: Parameter 1 is "Implicit member", should be "String", in call to func Test.stringFunc(_ string: String)
stringFunc(String.foo) // E: No static member "foo" on type "String"
For some reason, the compiler can’t find String.foo either implicitly or explicitly.