C#: Update AST printing to include generated cast (wrapping) expressions and generated ToString calls.

This commit is contained in:
Michael Nebel
2025-01-09 13:04:47 +01:00
parent 6c6e58b337
commit 53c2f76385

View File

@@ -32,7 +32,9 @@ private predicate shouldPrint(Element e, Location l) {
}
private predicate isImplicitExpression(ControlFlowElement element) {
element.(Expr).isImplicit() and
// Include compiler generated cast expressions and `ToString` calls if
// they wrap actual source expressions.
element.(Expr).stripImplicit().isImplicit() and
not element instanceof CastExpr and
not element.(OperatorCall).getTarget() instanceof ImplicitConversionOperator and
not element instanceof ElementInitializer