Skip to content
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

PackedByteArray.decode_u64 should warn about auto conversion to signed 64bit integer #10601

Open
Ombrezz opened this issue Feb 2, 2025 · 0 comments · May be fixed by godotengine/godot#102462
Labels
area:class reference Issues and PRs about the class reference, which should be addressed on the Godot engine repository enhancement

Comments

@Ombrezz
Copy link

Ombrezz commented Feb 2, 2025

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

@tetrapod00 tetrapod00 added enhancement area:class reference Issues and PRs about the class reference, which should be addressed on the Godot engine repository labels Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:class reference Issues and PRs about the class reference, which should be addressed on the Godot engine repository enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants