-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add static Print methods to ExpressionPrinter #29854
Conversation
And some cleanup Closes dotnet#29851
@@ -386,7 +393,7 @@ protected override Expression VisitBlock(BlockExpression blockExpression) | |||
} | |||
} | |||
|
|||
var expressions = blockExpression.Result != null | |||
var expressions = blockExpression.Expressions.Count > 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BlockExpression.Result is non-nullable, but does through for empty blocks (so this was a bug).
Expression expression, | ||
int? characterLimit = null) | ||
=> PrintCore(expression, characterLimit, verbose: false); | ||
public virtual string PrintExpression(Expression expression, int? characterLimit = null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C# doesn't allow static/non-static overloading where the signature is otherwise the same. Since the static API is what we're likely to use in debugging (where shorter names are the most important), I'm proposing to have a static Print, and a longer non-static PrintExpression (which we'd use only in code).
And some cleanup
Closes #29851