I expect this test to pass:
assertHasOneResult("[{\"s\": \"fo\", \"expected_size\": null}, {\"s\": \"lo\", \"expected_size\": 2}]", "$[?(@.s size @.expected_size)]", conf);
I don't see a reason to constrain the right operand of size to be constant. Given that its non-number-ness should be handled gracefully. I'll submit a patch in a day or two.