File tree 1 file changed +52
-0
lines changed
Tests/CSharp/ExpressionTests
1 file changed +52
-0
lines changed Original file line number Diff line number Diff line change @@ -913,4 +913,56 @@ public static void LogAndReset(ref int arg)
913
913
}" ) ;
914
914
}
915
915
916
+ [ Fact ]
917
+ public async Task ExtensionMethodsRefPropertyParameterAsync ( )
918
+ {
919
+ await TestConversionVisualBasicToCSharpAsync ( @"
920
+ Public Class ExtensionMethodsRefPropertyParameter
921
+ Public Property Number As Integer = 3
922
+ Public Sub WithExtensionMethod()
923
+ Number.NegEx()
924
+ End Sub
925
+ Public Sub WithMethod()
926
+ Neg(Number)
927
+ End Sub
928
+ End Class
929
+
930
+ Public Module MathEx
931
+ <Extension()>
932
+ Public Sub NegEx(ByRef num As Integer)
933
+ num = -num
934
+ End Sub
935
+ Public Sub Neg(ByRef num As Integer)
936
+ num = -num
937
+ End Sub
938
+ End Module" , @"
939
+ public partial class ExtensionMethodsRefPropertyParameter
940
+ {
941
+ public int Number { get; set; } = 3;
942
+ public void WithExtensionMethod()
943
+ {
944
+ int argnum = Number;
945
+ argnum.NegEx();
946
+ Number = argnum;
947
+ }
948
+ public void WithMethod()
949
+ {
950
+ int argnum = Number;
951
+ MathEx.Neg(ref argnum);
952
+ Number = argnum;
953
+ }
954
+ }
955
+
956
+ public static partial class MathEx
957
+ {
958
+ public static void NegEx(this ref int num)
959
+ {
960
+ num = -num;
961
+ }
962
+ public static void Neg(ref int num)
963
+ {
964
+ num = -num;
965
+ }
966
+ }" ) ;
967
+ }
916
968
}
You can’t perform that action at this time.
0 commit comments