Skip to content

Add warning for using array pattern with packed arrays#11907

Open
stdc105 wants to merge 1 commit intogodotengine:masterfrom
stdc105:master
Open

Add warning for using array pattern with packed arrays#11907
stdc105 wants to merge 1 commit intogodotengine:masterfrom
stdc105:master

Conversation

@stdc105
Copy link
Copy Markdown

@stdc105 stdc105 commented Apr 5, 2026

I've recently encountered a "papercut" when using pattern matching after String.split: the split result is a PackedStringArray that does not work with array patterns. While there is a warning in the pattern matching about the type strictness above, it might also help to add an additional warning in the "Array pattern" section as it's pretty far down in the docs, a couple screens of scroll from the warning above.

I wonder if it's also worth a proposal to add matching packed arrays with array pattern too, as they are quite similar to arrays in many ways, and definitely more comparable to StringName vs. String than float vs. int.

@stdc105 stdc105 requested review from a team as code owners April 5, 2026 08:12
@skyace65 skyace65 added enhancement topic:gdscript area:manual Issues and PRs related to the Manual/Tutorials section of the documentation labels Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:manual Issues and PRs related to the Manual/Tutorials section of the documentation enhancement topic:gdscript

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants