Open this-is-envy opened 3 weeks ago
This is not implemented currently - either it's a relatively new syntax or it was overlooked.
Thanks for the quick triage -- I actually came to say that I have no idea what's going on 😀.
My background is pretty deep but distinctly not-gdscript so I thought (type)(expr)
was valid and my project was working when run. At some point godot cleared a cache though and I started getting weird errors that I traced back to (plausibly) this being invalid grammar / not parsing.
Per https://docs.godotengine.org/en/stable/tutorials/scripting/gdscript/gdscript_basics.html#casting x as y
seems to be the only valid cast syntax so I'm going to preemptively close this and be somewhat confused at what was going on yesterday.
To me it looks like that syntax works in Godot. Anyway - I'll reopen this issue and do deep analysis of Godot behavior in that case.
In the following code gdformat fails to parse:
The output is as follows: