I have a problem with generics in swift. Let\'s expose my code.
protocol FooProtocol { associatedtype T } protocol Fooable { } extension Int : Fooable { }
Is the following what you tried to achieve? (compiled & tested with Xcode 11.4)
func createOne() -> some FooProtocol { let anyFoo = AnyFoo(p: FooImpClass()) return anyFoo }