fix: non-reconstructable services are erased when imported #1144
Labels
status: needs triage
Issues which needs to be reproduced to be verified report.
type: fix
Issues describing a broken feature.
Description
I found a bug in my fork of TypeDI,
and I thought I'd be a good neighbour by also posting it here.
With the current inheritance code, when a value is imported from
the default container, its value is always set to
EMPTY_VALUE
.This breaks non-reconstructable services, which lack either a type
or a factory which allows for re-constructing the service.
Minimal code-snippet showcasing the problem
StackBlitz Demo
Full error:
Expected behavior
If a service can't be reconstructed from a type or a factory, it shouldn't
be erased when imported from the default container.
Actual behavior
The value is always erased.
The problem is caused by this line:
typedi/src/container-instance.class.ts
Line 96 in 072fbf9
The text was updated successfully, but these errors were encountered: