Skip to content

Commit 20ff2d1

Browse files
committed
Added support for explisit cast/cast expression.
1 parent 19fd127 commit 20ff2d1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

CSharpToJavaScript/Walker.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2941,6 +2941,9 @@ public override void VisitParenthesizedExpression(ParenthesizedExpressionSyntax
29412941
if (nodesAndTokens[1].IsKind(SyntaxKind.AsExpression))
29422942
_IgnoreAsParenthesis = true;
29432943

2944+
if (nodesAndTokens[1].IsKind(SyntaxKind.CastExpression))
2945+
_IgnoreAsParenthesis = true;
2946+
29442947
for (int i = 0; i < nodesAndTokens.Count; i++)
29452948
{
29462949
SyntaxNode? asNode = nodesAndTokens[i].AsNode();
@@ -3060,6 +3063,9 @@ public override void VisitParenthesizedExpression(ParenthesizedExpressionSyntax
30603063
case SyntaxKind.AnonymousObjectCreationExpression:
30613064
VisitAnonymousObjectCreationExpression((AnonymousObjectCreationExpressionSyntax)asNode);
30623065
break;
3066+
case SyntaxKind.CastExpression:
3067+
VisitCastExpression((CastExpressionSyntax)asNode);
3068+
break;
30633069
default:
30643070
Log.ErrorLine($"asNode : {kind}\n|{asNode.ToFullString()}|");
30653071
break;

0 commit comments

Comments
 (0)