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
Resources with typed arrays of resources show up as the path to the resource instead of the class name in editor causing an error that the type does not match.
#95851
Open
ryanbbernstein opened this issue
Aug 20, 2024
· 2 comments
Resources with typed arrays of resources show up as the path to the resource instead of the class name in editor causing an error that the type does not match. Removing the typing in script logic accessing the array fixes the error and the script runs correctly.
Yep, looks like it. I searched through the existing issues before posting and couldn't find anything related. Probably because the title doesn't include the word resource. Thanks
Tested versions
System information
Mac OS Sonoma M1
Issue description
Resources with typed arrays of resources show up as the path to the resource instead of the class name in editor causing an error that the type does not match. Removing the typing in script logic accessing the array fixes the error and the script runs correctly.
Resource contains:
Accessing it like so:
Produces:
Parse Error: Unable to iterate on value of type "Array[res://test_res.gd]" with variable of type "test_res".
I believe this is related to the following changes: #78219 #90751 #85024
Steps to reproduce
Create resource that contains an array of custom resources. Attempt to iterate or access values from the array as the custom resource class type.
Minimal reproduction project (MRP)
Minimum example files
testgd.zip
The text was updated successfully, but these errors were encountered: