You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed the following strange behavior on master as of 4dcf2c5:
func _ready():
var list: Array = []
list = [1,2,3,4]
list += [1,2]
print(list) # should print: [1,2,3,4,1,2] prints: [1,2]
list += []
print(list) # should print: [1,2,3,4,1,2] prints: []
var list2: Array = [1,2,3]
list += list2
print(list) # should print: [1,2,...2,3] prints: [1,2,3]
It appears that += overwrites the current data instead of appending.
FWIW, just writing var list = [] doesn't trigger the problem. So it's likely something with type Array. Array.append_array doesn't suffer from the problem.
The problem is similar to #72948, however this involves not a typed array only the type Array, and I haven't seen an error. The data just disappears silently. But it might still be fixed by #73540. Haven't tested yet.
Steps to reproduce
See issue description.
Minimal reproduction project
N/A
The text was updated successfully, but these errors were encountered:
Godot version
4.1.dev (4dcf2c5)
System information
Debian Linux, rendering N/A
Issue description
I noticed the following strange behavior on master as of 4dcf2c5:
It appears that
+=
overwrites the current data instead of appending.FWIW, just writing
var list = []
doesn't trigger the problem. So it's likely something with typeArray
.Array.append_array
doesn't suffer from the problem.The problem is similar to #72948, however this involves not a typed array only the type Array, and I haven't seen an error. The data just disappears silently. But it might still be fixed by #73540. Haven't tested yet.Steps to reproduce
See issue description.
Minimal reproduction project
N/A
The text was updated successfully, but these errors were encountered: