Open georgwiese opened 7 years ago
Well, as it turns out, forward reference is not supported yet. Sorry. I will look into this as soon as I have a moment.
Enforce can accept strings as type hints but the types need to exist at the moment of decorating.
I think it is not very hard to fix, just gonna take some time. Forward reference need to invoke a validation tree generation when it is encountered for the first time and replace itself with it before proceeding. I think this is the fastest way to implement it at the moment.
Thanks for the report!
Run into this a few times as well. Would love for forward refs to be implemented.
BTW, the dev
branch now supports Forward References. If you have some time - please give it a try. Thanks.
Do you support forward references? I'm getting this behavior:
The error states:
Argument 'x' was not of type typing.List<~T>[typing.Union[int, _ForwardRef('MyType')]]. Actual type was typing.List[int, typing.List].
Are forward references not supported, is this a bug, or am I doing something wrong? Thanks :)