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
Which says that the T of @paramDecoratorFabric is kind of a different thing that doesn't belong to the "place" where it was used.
π» Use Cases
I'm actively working on my RPC-ish library and one of the biggest downsides comparing to other RPC libraries is inability to automatically recognise Zod types provided at the controller. This requires to add the type to the controller method manually but also to create extra variables.
I understand that adding ability to modify method/class type by a decorator is quite challenging. But I hope that changing the "scope" of generics isn't that big deal. With the feature I'm requesting I would be able to achieve the goal without defining extra variables:
The method and the parameter already share B and Q, and since @vovkZod is used "inside" of this definition, it makes sense for it to be able to also use B and Q.
The text was updated successfully, but these errors were encountered:
π Search Terms
decorator generic
decorator set type
β Viability Checklist
β Suggestion
There are multiple requests to be able to modify class or its methods type
#4881
#49229
But I haven't found a much simpler request: be able to share property decorator fabric generic with its method.
π Motivating Example
There is the decorator fabric example, nothing fancy:
And there is what I would be happy to be able to achieve:
Unfortunately, I get the following error:
Which says that the
T
of@paramDecoratorFabric
is kind of a different thing that doesn't belong to the "place" where it was used.π» Use Cases
I'm actively working on my RPC-ish library and one of the biggest downsides comparing to other RPC libraries is inability to automatically recognise Zod types provided at the controller. This requires to add the type to the controller method manually but also to create extra variables.
I understand that adding ability to modify method/class type by a decorator is quite challenging. But I hope that changing the "scope" of generics isn't that big deal. With the feature I'm requesting I would be able to achieve the goal without defining extra variables:
The method and the parameter already share B and Q, and since
@vovkZod
is used "inside" of this definition, it makes sense for it to be able to also use B and Q.The text was updated successfully, but these errors were encountered: