Add warning to documentation against explicit upcasts and downcasts.
Test cases for some boolean ir functions.