PackedByteArray.decode_u64 should warn about auto conversion to signed 64bit integer #10601
Labels
area:class reference
Issues and PRs about the class reference, which should be addressed on the Godot engine repository
enhancement
Your Godot version: v4.3
Issue description: The PackedByteArray.decode_u64 description says that it returns an unsigned 64 bit integer from an array of values. This is technically true, but since GDScript only supports signed 64 bit integers, it converts the result immediately after returning to a signed value. This is very confusing for developers who are expecting an unsigned integer as the documentation explicitly says and get back a signed one. The documentation should explicitly say that if ran in GDScript, the result will automatically be cast to a signed number.
URL to the documentation page: https://docs.godotengine.org/en/stable/classes/class_packedbytearray.html#class-packedbytearray-method-decode-u64
If you know how to fix the issue you are reporting please
consider opening a pull request. We provide a tutorial on
using git here: https://docs.godotengine.org/en/stable/community/contributing/pr_workflow.html,
writing documentation at https://docs.godotengine.org/en/stable/community/contributing/docs_writing_guidelines.html
and contributing to the class reference here: https://docs.godotengine.org/en/stable/community/contributing/updating_the_class_reference.html
The text was updated successfully, but these errors were encountered: