Open wangsyiiz opened 5 months ago
ok, actually I found another decorator @named
can be used in normally, but still in documentation it indicates to use @targetName
, is that a wrong description?
Both are documented, here's @named
's: https://github.com/inversify/InversifyJS/blob/7619dd4395516fa53f435d08f30cead349901be8/wiki/named_bindings.md
The error comes from the signature of @targetName
not properly matching the decorator signature anymore.
It's new on Typescript 5: https://github.com/microsoft/TypeScript/issues/52435
That said, I don't understand the difference between @named
and @targetName
. @named
seems slightly better supported, and @targetName
's docs mention the use of namedConstraint
, which doesn't work because it works on a different tag.
Created #1561 to fix this.
Expected Behavior
There should not be any error occurred when
@targetName
be used at constructorCurrent Behavior
constructor(@inject("IService") @targetName("queueService") ticketQueue: IService) { }
error TS1239: Unable to resolve signature of parameter decorator when called as an expression
Possible Solution
Steps to Reproduce (for bugs)
Context
Your Environment
Stack trace