mirror of
https://github.com/github/codeql.git
synced 2026-04-23 15:55:18 +02:00
C#: Update AST printing to include generated cast (wrapping) expressions and generated ToString calls.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user