-
-
Notifications
You must be signed in to change notification settings - Fork 21k
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 2.0: assert()
containing line breaks results in an syntax error
#66535
Comments
This is correct? You can't do this in any other context either. |
@TheDuriel Idk but I was wondering if it was allowed cuz it was possible in 3.5. Normal calls allow line breaks like this: my_func(
"text",
1234,
true
) |
What's letting you do that there, is the comma "escaping the linebreak".
Should work. OR and other operators require your code to continue on the same line. |
Yup, I know. Is it okay to recognize that it has become stricter? |
I'm not convinced from your example that is has. |
I checked it again. assert((
1 +
1
)) # works ceil(
0.0) # OK
assert(
true) # Error |
It'd be nice if you could do exact comparisons between 3.x and 4.x for this. With normal function calls and asserts. |
Sorry, I looked further and it seems that regardless of the operator, simply cannot break a line. |
assert()
containing line breaks results in an syntax error.assert()
containing line breaks results in an syntax error.
assert()
containing line breaks results in an syntax error.assert()
containing line breaks results in an syntax error
To complete use cases, I had this issue when splitting my long assert message over multiple lines: assert(is_on_floor(), "_get_floor_tangent: is_on_floor() is true yet get_floor_normal() " +
"returned Vector2.ZERO.") Replacing |
Godot version
v4.0.beta1.official [20d6672]
System information
It's not system specific error.
Issue description
Any condition containing newlines in assert's
()
will result in a syntax (grammatical?) error.Steps to reproduce
But. Its works with
\
:Minimal reproduction project
Include line breaks in assert expression.
The text was updated successfully, but these errors were encountered: