File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1860,7 +1860,16 @@ RefConversion GetRefConversion(VBSyntax.ExpressionSyntax expression)
18601860 bool IsRefArrayAcces ( VBSyntax . ExpressionSyntax expression )
18611861 {
18621862 if ( ! ( expression is VBSyntax . InvocationExpressionSyntax ies ) ) return false ;
1863- return _semanticModel . GetOperation ( ies ) . IsArrayElementAccess ( ) && GetRefConversion ( ies . Expression ) == RefConversion . Inline ;
1863+ var op = _semanticModel . GetOperation ( ies ) ;
1864+ return ( op . IsArrayElementAccess ( ) || IsReturnsByRefPropertyElementAccess ( op ) )
1865+ && GetRefConversion ( ies . Expression ) == RefConversion . Inline ;
1866+
1867+ static bool IsReturnsByRefPropertyElementAccess ( IOperation op )
1868+ {
1869+ return op . IsPropertyElementAccess ( )
1870+ && op is IPropertyReferenceOperation { Property : { } prop }
1871+ && ( prop . ReturnsByRef || prop . ReturnsByRefReadonly ) ;
1872+ }
18641873 }
18651874 }
18661875
You can’t perform that action at this time.
0 commit comments