If anything, this is actively wrong, because for example it'd reject a polymorphic operator that yields boolean in-context.
In general, this code looks like a mess. There are a lot of Asserts that might be okay in development but probably should not have got committed, and the comments need work.
These assertions were removed by me, too.
I didn’t modify these code comments since English isn’t my native language, and I’d appreciate your help with them.