Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GDScript now supports typed for-loops #256

Closed
Shinigami92 opened this issue Nov 30, 2023 · 2 comments
Closed

GDScript now supports typed for-loops #256

Shinigami92 opened this issue Nov 30, 2023 · 2 comments
Labels
duplicate This issue or pull request already exists

Comments

@Shinigami92
Copy link
Contributor

Shinigami92 commented Nov 30, 2023

GDScript 4.2 now supports typed for loops

e.g.:

- for chunk        in _chunks.values():
+ for chunk: Chunk in _chunks.values():

gdlint and gdformat both result (obviously) in an error like:

        for chunk: Chunk in _chunks.values():
                 ^

Unexpected token Token('COLON', ':') at line 40, column 11.
Expected one of: 
        * IN
Previous tokens: [Token('NAME', 'chunk')]
@Shinigami92
Copy link
Contributor Author

Oh... seems there is already support for this:

But might it be that it is not release yet?
I reran pip3 install "gdtoolkit==4.*"

@Scony
Copy link
Owner

Scony commented Nov 30, 2023

Yes, it was not released as I was waiting for the official Godot release.
Anyway, I've just released 4.2.0.

@Scony Scony closed this as completed Nov 30, 2023
@Scony Scony added the duplicate This issue or pull request already exists label Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants