On Sunday, 18 June 2023 at 16:58:15 UTC, Ali Çehreli wrote:
The problem is with the deduced type of 'services'. I don't
know the mechanism behind it but the common type of 'truck' and
'ship' are deduced to be Object. Apparently, their interfaces
don't take part in that decision. I don't know
On 6/18/23 07:37, Salih Dincer wrote:
>auto truck = new Truck;
>auto ship = new Ship;
>
>auto services = [ truck, ship ];
The problem is with the deduced type of 'services'. I don't know the
mechanism behind it but the common type of 'truck' and 'ship' are
deduced to be Object.
Hi, below is an example of DI-dependency injection with 3
versions nested in the code. If you remove the leading //
characters, you will not get the "no property `deliver` for
`service` of type `object.Object`" error. Because version-2I
with interface wants its methods to depend on Object..