We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 625b8b1 commit 0e79753Copy full SHA for 0e79753
1 file changed
CodeConverter/CSharp/ExpressionNodeVisitor.cs
@@ -1833,7 +1833,9 @@ private RefConversion NeedsVariableForArgument(VBasic.Syntax.ArgumentSyntax node
1833
RefConversion GetRefConversion(VBSyntax.ExpressionSyntax expression)
1834
{
1835
var symbolInfo = GetSymbolInfoInDocument<ISymbol>(expression);
1836
- if (symbolInfo is IPropertySymbol propertySymbol) {
+ if (symbolInfo is IPropertySymbol propertySymbol
1837
+ // a property in VB.NET code can be ReturnsByRef if it's defined in a C# assembly the VB.NET code references
1838
+ && !propertySymbol.ReturnsByRef && !propertySymbol.ReturnsByRefReadonly) {
1839
return propertySymbol.IsReadOnly ? RefConversion.PreAssigment : RefConversion.PreAndPostAssignment;
1840
}
1841
0 commit comments