BUG OF THE MONTH | Strange formatting

V3033 It is possible that this ‘else’ branch must apply to the previous ‘if’ statement. TreeConverter syntax_tree_visitor.cs 14894

public override void visit(....)
  if (_var_def_statement.inital_value != null)
    if (is_event) AddError(....);

According to the logic of the program, the else keyword refers to the if (is_event) condition block. However, the code is formatted in such a way that creates quite a different impression. Perhaps, another pair of {} brackets would solve this problem.

Please click here to see more bugs from this project.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.