From b5ac515719ec0d88a95b6166c27e73260764066c Mon Sep 17 00:00:00 2001 From: Timur Kelman Date: Fri, 19 Jul 2024 13:45:58 +0200 Subject: [PATCH] consider OperationKind.PropertyReference assignable if ReturnsByRef --- CodeConverter/CSharp/OperationExtensions.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CodeConverter/CSharp/OperationExtensions.cs b/CodeConverter/CSharp/OperationExtensions.cs index 495e4f6f5..8ffbd3375 100644 --- a/CodeConverter/CSharp/OperationExtensions.cs +++ b/CodeConverter/CSharp/OperationExtensions.cs @@ -56,9 +56,10 @@ public static bool IsAssignableExpression(this IOperation operation) case OperationKind.DynamicMemberReference: return true; - //Just documenting since it's the only one mentioning reference that can't necessarily be assigned to AFAIK case OperationKind.PropertyReference: - return false; + //a property might be RefReturn, if it's defined in a referenced C# assembly + var prop = ((IPropertyReferenceOperation)operation).Property; + return prop.ReturnsByRef || prop.ReturnsByRefReadonly; } return false;