Skip to content

VB -> C#: Property Getter is used instead of Setter for ref argument #909

Closed

Description

@BlackEagleXV

VB.Net input code

Db.Get_Equal(QAdr, 0, Db.Qr(CourseBuffer, 21), recordPositionQAdr, errorCode)

'Method header
Public Sub Get_Equal(ByRef tableBuffer As Integer, ByRef keyIndex As Integer, ByRef keyValue As String, ByRef recordPosition As String, ByRef errorNumber As Integer) Implements IclsDB.Get_Equal

'Property
Public Property Qr(ByVal tableBuffer As Integer, ByVal fieldNumber As Integer) As String Implements IclsDB.Qr
    Get
        Return RecordValues(tableBuffer, fieldNumber)
    End Get
    Set(ByVal value As String)
        RecordValues(tableBuffer, fieldNumber) = value
    End Set
End Property

Erroneous output

int argkeyIndex1 = 0;
string argkeyValue = Euro_Str.Db.get_Qr(CourseBuffer, 21);
Euro_Str.Db.Get_Equal(ref Euro_Str.QAdr, ref argkeyIndex1, ref argkeyValue, ref recordPositionQAdr, ref errorCode);
Euro_Str.Db.get_Qr(CourseBuffer, 21) = argkeyValue;

//Method Get_Equal was not converted and is still VB, which is ok
//Property Qr was not converted and is still VB, which is ok

Expected output

int argkeyIndex1 = 0;
string argkeyValue = Euro_Str.Db.get_Qr(CourseBuffer, 21);
Euro_Str.Db.Get_Equal(ref Euro_Str.QAdr, ref argkeyIndex1, ref argkeyValue, ref recordPositionQAdr, ref errorCode);
Euro_Str.Db.set_Qr(CourseBuffer, 21, argkeyValue);

//Method Get_Equal was not converted and is still VB, which is ok
//Property Qr was not converted and is still VB, which is ok

Details

Activity

  1. added
    VB -> C#
    on Jun 28, 2022
  2. changed the title [-]VB -> C#: Getter Property is used instead of Setter Property[/-] [+]VB -> C#: Property Getter is used instead of Setter for ref argument[/+] on Jun 28, 2022
  3. added
    compilation error
    on Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    VB -> C#compilation error

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions