Your Godot version:
4.7.stable
Issue description:
The second note says that: "Encoding Callable is not supported and will result in an empty value, regardless of the data." The empty value is technically not empty, because when I've made a simple check in the editor:
func testfunc():
pass
func _ready():
var bytes = var_to_bytes(testfunc)
print(bytes)
It prints [25, 0, 0, 0]. So it's not an empty array, but array with some data. But Callable is not valid after deserialization:
var restored = bytes_to_var(bytes)
print("Restored value: ", restored)
print("Is Callable: ", restored is Callable)
if restored is Callable:
print("Is that Callable valid: ", restored.is_valid())
It prints the following:
Restored value: null::null
Is Callable: true
Is that Callable valid: false
I think the documentation would be more accurate if it says that it returns an invalid or empty Callable, rather than suggest that the byte representation is empty.
URL to the documentation page:
https://docs.godotengine.org/en/4.7/classes/class_@globalscope.html#class-globalscope-method-var-to-bytes
Your Godot version:
4.7.stable
Issue description:
The second note says that: "Encoding Callable is not supported and will result in an empty value, regardless of the data." The empty value is technically not empty, because when I've made a simple check in the editor:
It prints
[25, 0, 0, 0]. So it's not an empty array, but array with some data. But Callable is not valid after deserialization:It prints the following:
I think the documentation would be more accurate if it says that it returns an invalid or empty Callable, rather than suggest that the byte representation is empty.
URL to the documentation page:
https://docs.godotengine.org/en/4.7/classes/class_@globalscope.html#class-globalscope-method-var-to-bytes