The VBUC provides a feature that removes ByRef arguments when the argument is not being changed inside the method. As we don’t know all the implementing classes for an interface and the use of the argument inside all the implementing methods, we are avoiding this feature for the methods interfaces. This means that if there is a ByRef argument in an exposed method inside an interface, this argument won’t be changed to ByVal. In addition, this argument in all implementing methods will be ByRef too.
The feature that changes ByRef arguments to ByVal is only applied for C# upgrading, so this interface feature applies just for C# too.
AnInterface.cls Sub goo(arg1 As Integer) End Sub Function foo(ByRef arg1 As Integer) As String End Function AClass.cls Implements AnInterface Sub AnInterface_goo(arg1 As Integer) End Sub Function AnInterface_foo(ByRef arg1 As Integer) As String End Function
AnInterface.cls public void goo(ref int arg1) { } public string foo(ref int arg1) { return String.Empty; } AClass.cls internal class AClass : AnInterface { public void goo(ref int arg1) { } public string foo(ref int arg1) { return String.Empty; } }
8834 N Capital of Texas Hwy, Ste 302
Austin, TX 78759
Call us: +1 (425) 609-8458
info@wearegap.com