Actions
Bug #20931
closedUsing `in` as an expression requires extra parentheses
Bug #20931:
Using `in` as an expression requires extra parentheses
Description
TBH - I'm not sure if this is a bug or not - but it certainly surprising behavior and I'd at least like to understand it.
Given a hash t - that can be pattern matched: t = {a: 1, b:1 }
Presumably this is because = binds higher than in - so that expression is equivalent to (r = t) in {a: 1, c: 1}
But in that case - why does using the results of in require an additional set of parentheses to avoid a syntax error when the result of the expression is used as an argument to a method?
Especially since this works fine:
Actions