Skip to content

Commit

Permalink
[c#] fix erroneous not-handled-yet warning for MemberBindingExpression (
Browse files Browse the repository at this point in the history
  • Loading branch information
xavierpinho authored Jan 22, 2025
1 parent 4da71f8 commit 3d82f38
Showing 1 changed file with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -507,21 +507,15 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) {
baseType: Option[String] = None
): Seq[Ast] = {
val baseNode = createDotNetNodeInfo(condAccExpr.json(ParserKeys.Expression))
val baseAst = astForNode(baseNode)

val baseTypeFullName =
if (getTypeFullNameFromAstNode(baseAst).equals(Defines.Any)) baseType
else Option(getTypeFullNameFromAstNode(baseAst))
baseType.orElse(Some(getTypeFullNameFromAstNode(astForNode(baseNode)))).filterNot(_.equals(Defines.Any))

Try(createDotNetNodeInfo(condAccExpr.json(ParserKeys.WhenNotNull))).toOption match {
case Some(node) =>
node.node match {
case ConditionalAccessExpression =>
astForConditionalAccessExpression(node, baseTypeFullName)
case MemberBindingExpression => astForMemberBindingExpression(node, baseTypeFullName)
case InvocationExpression =>
astForInvocationExpression(node)
case _ => astForNode(node)
case ConditionalAccessExpression => astForConditionalAccessExpression(node, baseTypeFullName)
case MemberBindingExpression => astForMemberBindingExpression(node, baseTypeFullName)
case _ => astForNode(node)
}
case None => Seq.empty[Ast]
}
Expand Down

0 comments on commit 3d82f38

Please sign in to comment.