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: support variable definition as condition in if-statement #98538

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zjin123
Copy link

@zjin123 zjin123 commented Oct 26, 2024

As suggested by @KoBeWi, this PR is separated from #98335. It closes godotengine/godot-proposals#2727 by allowing one variable definition as condition in if-statement (e.g. if var n := foo():).

For discussion of a new syntax for mixing multiple variable definitions and expressions in a single if-statement (e.g. if var n := foo(), n > 100:), please refer to #98335.

@zjin123 zjin123 requested review from a team as code owners October 26, 2024 00:21
@Calinou Calinou added this to the 4.x milestone Oct 26, 2024
@AThousandShips AThousandShips changed the title GDScript: support variable definition as condition in if-statement (godotengine/godot-proposals#2727) GDScript: support variable definition as condition in if-statement Oct 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow to define variables inside conditions
2 participants