-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FAQ] Is it possible to check that an object can be cast to the type (something like "test" is B
)?
#433
Comments
"test" is str
)?"test" is A
)?
"test" is A
)?"test" is B
)?
KCL currently supports two types of type assertions: As an aside, although implementing complex reflections for KCL is not that difficult, perhaps we can increase the ability of |
In finally I wan create some logic for type Something like:
In my current task type hierary is something like: |
I see. To achieve this, there is currently no great way in KCL. Possible solutions in the future:
|
"test" is B
)?"test" is B
)?
General Question
I want to check that an obkect can be cast to the type.
Currently I found only one method: get type name with
typeof
and compare with target type name and all of childs target type names.For example:
The text was updated successfully, but these errors were encountered: