private Expr TryEvaluate(ExprNode e, string exprStr) { Expr expr; object?constantValue = null; try { constantValue = ConstantExpressionEvaluator.Evaluate(e); } catch { } if (constantValue is { })
public static bool TryEvaluateAs <T>(ExprNode node, out T result) { object?res = new ConstantExpressionEvaluator().Visit(node); if (res is { } && res is T castRes)