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
Hi there!
I'm having an issue, where all the generated models which reference other models are typed as someProp: types.union(types.undefined, types.late((): any => SomeNameModel))
The issue I'm having is with the "any" literal typing, which instead of typing "someProp" as being of type "SomeNameModel", it gets typed as "any".
While digging into the code, I understand that when generated with the command gets run with "--format ts" attribute, ": any" type is hardcoded. Link to file.
I'm not sure if this was intended to solve this issue, but it does not seems to be causing that problem.
Could that "any" typing be removed?
The text was updated successfully, but these errors were encountered:
Their reasoning is that since the data is type-safe at runtime, casting the any back into your model type is OK. Though from a cleanliness perspective it's not ideal.
Hi there!
I'm having an issue, where all the generated models which reference other models are typed as
someProp: types.union(types.undefined, types.late((): any => SomeNameModel))
The issue I'm having is with the "any" literal typing, which instead of typing "someProp" as being of type "SomeNameModel", it gets typed as "any".
While digging into the code, I understand that when generated with the command gets run with "--format ts" attribute, ": any" type is hardcoded. Link to file.
I'm not sure if this was intended to solve this issue, but it does not seems to be causing that problem.
Could that "any" typing be removed?
The text was updated successfully, but these errors were encountered: