Hello, I got a function not found error when I tried to write a module like this:
public protocol ImportantProto {
associatedtype T
static func simpleExternal()
}
internal protocol MyImpl : ImportantProto {
static func complicatedInnerCall(_:T,_:T,_:T,_:T,_:T,_:_:_:_:)
}
extension MyImpl {
public static func simpleExternal() {
lots;
of;
shared;
boilerplate;
generic;
over;
T;
think;
BLAS/lapack;
return complicatedInnerCall( , , , , , , , , , )
}
} // shared between types
public struct TypeOne : ImportantProto {
typealias T = T1
} // simpleExternal() conformance comes below
extension TypeOne : MyImpl {
complicatedInnerCall() { ... }
}
public struct TypeTwo : ImportantProto ...
Calling simpleExternal() from outside is "function not found", surprisingly: TypeOne is publicly declared to conform to ImportantProto, so publicly should have a simpleExternal() available.
I found this back in 2018, discussing essentially the same thing. The "Automatic generated public func shared() for every comforming type" proposal still isn't here yet.
The bottom line: is there a one-liner to manually declare/generate this public static simpleExternal() for each type?