Expression.some does not work
adrianmroz opened this issue · comments
Adrian Mróź commented
Expression.some
does not work properly.
Examples:
const e1 = Expression.parse("$main.countDistinct($user)");
const e2 = Expression.parse("$main.countDistinct($user) * 100");
Check:
e1.some(e => e instanceof CountDistinctExpression); // returns true
e2.some(e => e instanceof CountDistinctExpression); // returns false
That's because here:
plywood/src/expressions/baseExpression.ts
Line 969 in 574c6aa
we always return some boolean, and inside:
plywood/src/expressions/baseExpression.ts
Line 2076 in 574c6aa
we early return if we get non-null value. So everyHelper
doesn't recurse and can't find correct expression nested.