Skip to content

Commit b5ac515

Browse files
Timur KelmanTimur Kelman
authored andcommitted
consider OperationKind.PropertyReference assignable if ReturnsByRef
1 parent 79d6f8a commit b5ac515

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

CodeConverter/CSharp/OperationExtensions.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,10 @@ public static bool IsAssignableExpression(this IOperation operation)
5656
case OperationKind.DynamicMemberReference:
5757
return true;
5858

59-
//Just documenting since it's the only one mentioning reference that can't necessarily be assigned to AFAIK
6059
case OperationKind.PropertyReference:
61-
return false;
60+
//a property might be RefReturn, if it's defined in a referenced C# assembly
61+
var prop = ((IPropertyReferenceOperation)operation).Property;
62+
return prop.ReturnsByRef || prop.ReturnsByRefReadonly;
6263
}
6364

6465
return false;

0 commit comments

Comments
 (0)