convertToLiteralIfNeeded function

dynamic convertToLiteralIfNeeded(
  1. dynamic val,
  2. dynamic other
)

Implementation

dynamic convertToLiteralIfNeeded(dynamic val, dynamic other) {
  if ((val is num || val is Complex) && other is Expression) {
    return Literal(val);
  }
  return val;
}