GDScript: Improve usability of setter chains
- Consider PackedArrays non-shared since they are copied on C++/script boundaries. - Add error messages in the analyzer when assigning to read-only properties. - Add specific error message at runtime when assignment fails because the property is read-only.
This commit is contained in:
parent
315d3c4d21
commit
5fc7918594
13 changed files with 92 additions and 19 deletions
|
|
@ -0,0 +1,4 @@
|
|||
func test():
|
||||
var tree := SceneTree.new()
|
||||
tree.root = Window.new()
|
||||
tree.free()
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Cannot assign a new value to a read-only property.
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
func test():
|
||||
var state := PhysicsDirectBodyState3DExtension.new()
|
||||
state.center_of_mass.x += 1.0
|
||||
state.free()
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Cannot assign a new value to a read-only property.
|
||||
Loading…
Add table
Add a link
Reference in a new issue