TALES boolean coercion
At times, TALES needs to interpret the result of an expression as a boolean (true/false) value.
If the expression result is not already a System.Boolean
then TALES will perform automatic
type coercion, according to the following rules:
- A
null
reference is false - Non-null instances of nullable reference types are true
-
Instances of non-nullable value types are true if they are not equal to
default(T)
for their type. Otherwise they are false
Beware that the not:
expression prefix has its
own rules for interpreting values as a boolean.