The caveats of implicit operator bool?

I spent over an hour trying to track down a bug that eventually crept up. It turned out this was the cuplrit:

bool MyCompare(GameObject go)
{
return (go = this.gameObject);
}

Can you see the mistake?
I mistakenly used the assignment operator instead of equality operator.
When I finally found the mistake, I was confused as to why this code even complied to begin with.
Then I realized Unity implemented the implicit bool operator (which overall is great).

Has anyone else ever made this mistake?
I then tried to read on the internet what people felt about the implicit operator bool, and there’s a small following of people against it (A note of the wild use of “if(object)” in Unity’s C# code). Could programming mistakes like this be one reason to justify not implementing this operator?

I think everybody’s made this mistake at least once. If it happens enough you eventually adapt and never do it again. It’s an artefact of the C language where conditions were evaluated on whether they were 0 or not, as C had no bool/boolean type.

Yes, your topic title gives it away quite nicely. Made that mistake once and I must say I never actively use this implicit cast. (So, yes, I’m also against it.)