You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Decorator function return type 'abstract new (...args: never) => unknown' is not assignable to type 'void | typeof BaseController'.
Types of construct signatures are incompatible.
Type 'abstract new (...args: never) => unknown' is not assignable to type 'abstract new (logger: ILogger) => BaseController'.
Type 'unknown' is not assignable to type 'BaseController'.ts(1270)
Argument of type 'typeof BaseController' is not assignable to parameter of type 'abstract new (...args: never) => unknown'.
Cannot assign a 'protected' constructor type to a 'public' constructor type.ts(2345)
This error rise when I make constructor protected, I'm trying to find answer in Inversify docs but where is nothing about
Hey @AmirBazanov, you're right, @injectable is not only targeted by non abstract classes since you might be interested in provide child classes of BaseController. Therefore, it makes a lot of sense to allow using this decorator in classes with a protected constructor as long as the child class has a public constructor.
We have plans to update inject and injectable decorators to rely on ClassDecorator, MethodDecorator and PropertyDecorator as proposed on #1591. Once we go for it this issue should be solved.
This error rise when I make constructor protected, I'm trying to find answer in Inversify docs but where is nothing about
Example of my code
Why should it be public?
The text was updated successfully, but these errors were encountered: