Skip to content

Commit a265518

Browse files
Timur KelmanTimur Kelman
authored andcommitted
GetRefConversion: for const fields and locals always return RefConversion.PreAssigment
1 parent a22c24c commit a265518

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

CodeConverter/CSharp/ExpressionNodeVisitor.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1836,6 +1836,9 @@ RefConversion GetRefConversion(VBSyntax.ExpressionSyntax expression)
18361836
if (symbolInfo is IPropertySymbol propertySymbol) {
18371837
return propertySymbol.IsReadOnly ? RefConversion.PreAssigment : RefConversion.PreAndPostAssignment;
18381838
}
1839+
else if (symbolInfo is IFieldSymbol { IsConst: true } || symbolInfo is ILocalSymbol { IsConst: true }) {
1840+
return RefConversion.PreAssigment;
1841+
}
18391842

18401843
if (DeclaredInUsing(symbolInfo)) return RefConversion.PreAssigment;
18411844

0 commit comments

Comments
 (0)