In GDScript you can store a native type into a variable, but you cannot do much with it afterwards. You can only create an instance via `.new()`.

This is because you are not storing a type reference, but rather a special GDScript object, GDScriptNativeClass, and general Object or ClassDB API doesn't accept it as input in any way.

Would at least be nice to get the class name from the GDScriptNativeClass object directly, without instantiating first. It exists as a String member, but not exposed.

A script snippet, creating a variable named `x` and being assigned `Control`, which is a native Godot type. The type of the variable is then printed to the output. The an instance of `Button` is created and ClassDB API is used to check if it is related to the type stored in `x`. For that, `x` needs to be instantiated first.
0

If you have a fediverse account, you can quote this note from your own instance. Search https://mastodon.gamedev.place/users/yurisizov/statuses/115894494122739240 on your instance and quote it. (Note that quoting is not supported in Mastodon.)