b2 icon indicating copy to clipboard operation
b2 copied to clipboard

`if $(unset-var) in a b c` is always true

Open Kojoley opened this issue 2 years ago • 1 comments

local a ;
if $(a) in q w e {
    ECHO "wtf" ;
}

prints

wtf

Is this intended to work this way? Maybe it has some good uses, but I can't think of one. And $(a:E=) as a workaround could hit you in the back too when right hand side is variable.

Kojoley avatar Apr 23 '23 14:04 Kojoley

I just ran into a situation where we rely on this functionality: https://github.com/bfgroup/b2/blob/main/src/build/targets.jam#L1259

And thinking about it, it makes sense. As the in operator is equivalent to "A is a subset of B".

grafikrobot avatar Apr 07 '24 19:04 grafikrobot