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
"if-elif-else" branches will break if one of the "elif" statements is written on one line with the block that contains the other "if" statement #90016
Comments
Your script is parsed as:
(Note that the parser converts This could probably be considered a bug, but I need to look at the source code. |
See also (arguably a duplicate of this): |
@AThousandShips, yea, I understand now. It is a bit confusing, but make sense in some way. Still weird that it doesn't recognize missing indentation before |
I would consider this a bug since I would expect it to be formated like this # Doesn't work
if false: print("Will not be printed. Ok")
# Weird behaviour here
elif false: if true: print("Will not be printed. Ok")
else: print("Will not be printed. Ok")
else : print("Will not be printed. Ok") but changing it now will break compat so I'm not sure we should fix it. |
Tested versions
Tested in:
System information
Godot v4.2.1.stable - Fedora Linux 39 (Thirty Nine) - Tty - GLES3 (Compatibility) - NVCF () - AMD Athlon(tm) II X2 210e Processor (2 Threads)
Issue description
When writing
elif
with the related block, which contains otherif
, on one line, the next branhces will not be checked, and no errors will be produced.Steps to reproduce
Minimal reproduction project (MRP)
N/A
The text was updated successfully, but these errors were encountered: