Microsoft/TypeScript — pull request #823 by chrisbubernak (2014-10-04 02:07:16+00:00)
Title: Fix for issue #712

Fix for issue #712. The specific issue mentioned there concerns providing a more helpful error message when the ^ operator is used with 2 boolean operands. My change is slightly more general in that it generates an error for &, &=, ^, ^=, |, and |=. I used the error message mentioned in the issue:

"error TS0000: The ^ operator is not allowed for boolean types. Consider using !== instead."

When & or | are used with boolean values I suggest && and || respectively.

One interesting thing here is how to handle the assignment operators. Right now I show the same recommendation i.e. "consider using !==" shows up for both "^" and "^=" which, is maybe a bit confusing, but I wasn't sure the best way to do this. I've spoken briefly with @DanielRosenwasser about this but would be open to any other feedback for how to handle this.