Closed jessegrosjean closed 3 years ago
Yeah, you're deep into the generics "has associated type requirements" issue in Swift. You can't specialize the type as illustrated here. Hmmm.
The only thing I can think of is to type erase your protocol to some sort of AnyTestServiceType and inject that.
Thanks, that sounds reasonable to me.
I'm trying to use a service that has an associated type:
I think I understand why this is a problem in the generic case... but is there some way that I can register a concrete "instance" of this protocol with Resolver? For example I would like to register
TestServiceType <Int>
, but I can't figure out how.I'm not sure if I am just getting swift syntax wrong, or if it's just not possible. And if it isn't possible I'm wondering if there's some workaround that I can use?
Thanks, Jesse