Open d-enk opened 2 months ago
soft
flag includes checking whether TO
type (not interface
) can be in FROM
interface
looks like a very rare case, but still happens
in case of As
you can rely on the provider's error https://github.com/samber/do/blob/1998a7a1b1a618eed087c91bc4932934355d5477/service_alias.go#L161-L166
I suggest using something like:
instead simply:
For
As
just callcanCast[Initial, Alias]
https://github.com/samber/do/blob/1998a7a1b1a618eed087c91bc4932934355d5477/di_alias.go#L25-L26For
InvokeAs
apparently needgetInstanceType() reflect.Type
method https://github.com/samber/do/blob/1998a7a1b1a618eed087c91bc4932934355d5477/service.go#L131-L133