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
Is your feature request related to a problem? Please describe.
I have a macro that generates a struct with ::core::option::Option<_> (due to macro hygiene), and because of that, I cannot use ts(optional) on it.
Also in a more general way, I want to being able to mark a field as optional without having to use the Option type.
Describe the solution you'd like
Being able to mark a field as optional, whatever its type.
Describe alternatives you've considered
My current workaround for the ::core::option::Option<_> problem is to use ts(optional, as = "Option<_>") which isn't perfect.
The text was updated successfully, but these errors were encountered:
It is by design that #[ts(optional)] only works with Option, this has been discussed at length in the past, check out #175.
However, it is a bug that it does not work with a fully specified core::option::Option, this will be solved by #366, which changes how a type is verified to be an Option
While your particular problem will be fixed by #366, the feature you ask for will not be implemented,
I will close this issue and open a new one pointing to the fact that Option is vulnerable to type aliasing or otherwise spelling this type as anything other than Option, like fully qualifying it.
Is your feature request related to a problem? Please describe.
I have a macro that generates a struct with
::core::option::Option<_>
(due to macro hygiene), and because of that, I cannot usets(optional)
on it.Also in a more general way, I want to being able to mark a field as optional without having to use the
Option
type.Describe the solution you'd like
Being able to mark a field as optional, whatever its type.
Describe alternatives you've considered
My current workaround for the
::core::option::Option<_>
problem is to usets(optional, as = "Option<_>")
which isn't perfect.The text was updated successfully, but these errors were encountered: