godotengine / godotengine/godot-docs

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

Open
#10,601 0 comments 0 reactions 0 assignees View on GitHub
area:class reference enhancement
Dominant language
reStructuredText
Stars
5.7k
Forks
3.8k
Avg merge
1d 20h
Merged PRs (30d)
25

Description

**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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.