This occurs when writing circuits because the predicate returns a CircuitSignal instead of an actual boolean. The fix for this might just be improving the diagnostic - filtering on signals is probably a bad idea because it creates 2^n branches for n elements.