Skip to content

Commit 2a3d9db

Browse files
committed
Disallow turning a conditional into a ternary if there's a Not node without parentheses in the predicate
1 parent 74379e5 commit 2a3d9db

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/syntax_tree/node.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -5192,7 +5192,7 @@ def call(q, node)
51925192
else
51935193
# Otherwise, we're going to check the conditional for certain cases.
51945194
case node
5195-
in predicate: Assign | Command | CommandCall | MAssign | OpAssign
5195+
in predicate: Assign | Command | CommandCall | MAssign | Not | OpAssign
51965196
false
51975197
in {
51985198
statements: { body: [truthy] },

0 commit comments

Comments
 (0)