(fuzzer) - should the parser allow constructors in parentheses within if
condition and for
range?
#2996
Labels
bug
Something isn't working
Aim
Tried to parse the following code:
Expected Behavior
I know that constructors appearing directly after
if
andfor ... in
are disallowed, but I expected the code to parse and compile OK because the constructors are surrounded by parentheses.Bug
Got parse error
Expected an expression but found {
.This behavior is inconsistent with Rust lang, which allows the code to compile. Also, it does not quite make sense to disallow such syntax.
Most likely reason for the bug is the second argument to
expression_with_precedence
called fromexpression_no_constructors
:Installation Method
Compiled from source
Additional Context
Found by the parser-fuzzer tool.
Would you like to submit a PR for this Issue?
Yes, possible
The text was updated successfully, but these errors were encountered: