Have:
protocol MyProtocol {
var value: Int { get set }
}
class Foo: MyProtocol {
var value: Int
}
class Bar: MyProtocol {
var value: Int
}
Want:
function generate(value: _)
that infers the protocol-conforming class for instantiation:
let foo: Foo = generate(value: 1)
let bar: Bar = generate(value: 2)