coalesce<T extends Object> function Null safety

Expression<T> coalesce<T extends Object>(
  1. List<Expression<T>> expressions
)

Evaluates to the first expression in expressions that's not null, or null if all expressions evaluate to null.

Implementation

Expression<T> coalesce<T extends Object>(List<Expression<T>> expressions) {
  assert(expressions.length >= 2,
      'expressions must be of length >= 2, got ${expressions.length}');

  return FunctionCallExpression<T>('COALESCE', expressions);
}