toBool method

bool toBool()

Convert this expression to a bool, requires that this expression is either trueExpr or falseExpr.

Implementation

bool toBool() {
  if (this == currentContext.trueExpr) {
    return true;
  } else if (this == currentContext.falseExpr) {
    return false;
  } else {
    throw ArgumentError('cant be converted to bool: $this');
  }
}