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
This is a rewording of #379 focusing on Option not working properly if spelled any other way rather than making optional work with any type
Describe the bug
Whenever the Option type is spelled out as anything other than the word Option by itself, the #[ts(optional)] attribute fails to
recognize it as an Option, this is because of the extract_option_argument function, which expects the type to have only one
component, and expects that component to be the word Option with one generic argument.
This means spelling Option as core::option::Option (which is quite important for macros) or std::option::Option or creating some type
alias type Foo<T> = Option<T> and using the type Foo will cause compiler errors when using #[ts(optional)]
This is a rewording of #379 focusing on
Option
not working properly if spelled any other way rather than makingoptional
work with any typeDescribe the bug
Whenever the
Option
type is spelled out as anything other than the wordOption
by itself, the#[ts(optional)]
attribute fails torecognize it as an
Option
, this is because of theextract_option_argument
function, which expects the type to have only onecomponent, and expects that component to be the word
Option
with one generic argument.This means spelling
Option
ascore::option::Option
(which is quite important for macros) orstd::option::Option
or creating some typealias
type Foo<T> = Option<T>
and using the typeFoo
will cause compiler errors when using#[ts(optional)]
To Reproduce
Steps to reproduce the behavior:
Version
10.1
There is already a fix for this issue in #366, but this PR is a breaking change and still needs approval
The text was updated successfully, but these errors were encountered: