I'm trying to use the 'some' keyword with protocols and associate types as shown hereafter (Swift 5.6).
protocol Foo {
associatedtype yep
func yo(_ a:yep)
}
struct A: Foo {
func yo(_ a:String) {
print(a)
}
}
var a: some Foo = A()
a.yo("hello")
Unfortunately, I get the following error message regarding the last line:
I don't understand why the argument in the yo function should be the protocol's one (yep) instead of the struct's (String). (my approach should be refined ?)
Thanks in advance for your expert advice to find out the solution.
