mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
GDScript: Misc fixes and improvements for signature generation
* Use type hints for `@GlobalScope` enums. * Use plain `int` for `BitMask<T>`. * Fix type hints for typed arrays. * Use `Variant` and `void` type hints. * Discard unnecessary class prefix.
This commit is contained in:
parent
132000f58d
commit
9df96e97ea
2 changed files with 31 additions and 37 deletions
|
@ -4546,7 +4546,7 @@ GDScriptParser::DataType GDScriptAnalyzer::type_from_property(const PropertyInfo
|
|||
result.set_container_element_type(elem_type);
|
||||
} else if (p_property.type == Variant::INT) {
|
||||
// Check if it's enum.
|
||||
if ((p_property.usage & (PROPERTY_USAGE_CLASS_IS_ENUM | PROPERTY_USAGE_CLASS_IS_BITFIELD)) && p_property.class_name != StringName()) {
|
||||
if ((p_property.usage & PROPERTY_USAGE_CLASS_IS_ENUM) && p_property.class_name != StringName()) {
|
||||
if (CoreConstants::is_global_enum(p_property.class_name)) {
|
||||
result = make_global_enum_type(p_property.class_name, StringName(), false);
|
||||
result.is_constant = false;
|
||||
|
@ -4558,6 +4558,7 @@ GDScriptParser::DataType GDScriptAnalyzer::type_from_property(const PropertyInfo
|
|||
}
|
||||
}
|
||||
}
|
||||
// PROPERTY_USAGE_CLASS_IS_BITFIELD: BitField[T] isn't supported (yet?), use plain int.
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue