Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

VB -> C#: Omitted argument followed by a named argument is incorrectly named #808

Closed
Yozer opened this issue Jan 7, 2022 · 0 comments · Fixed by #809
Closed

VB -> C#: Omitted argument followed by a named argument is incorrectly named #808

Yozer opened this issue Jan 7, 2022 · 0 comments · Fixed by #809
Labels
VB -> C# Specific to VB -> C# conversion

Comments

@Yozer
Copy link
Member

Yozer commented Jan 7, 2022

VB.Net input code

Public Interface IResMain
    Sub CancelIndividualRoom(Optional cancelRef As String = "",
                             Optional depositList As Integer = 1,
                             Optional authKey As Integer = 2)
End Interface

Module Module1
    Sub Main()
        Dim test As IResMain
        test.CancelIndividualRoom(, authKey:=5)
    End Sub
End Module

Erroneous output

test.CancelIndividualRoom(depositList: 5);

Expected output

test.CancelIndividualRoom(authKey: 5);

Details

  • Product in use: VS extension
  • Version in use: 8.4.3.0
  • Did you see it working in a previous version, which?
  • Any other relevant information to the issue, or your interest in contributing a fix.

If you're unlucky and argument types are matching (like in the example) it can compile and change the application logic.
I will create PR with a fix.

@Yozer Yozer added the VB -> C# Specific to VB -> C# conversion label Jan 7, 2022
@Yozer Yozer changed the title VB -> C#: Omitted argument followed by named argument is incorrectly named VB -> C#: Omitted argument followed by a named argument is incorrectly named Jan 7, 2022
@Yozer Yozer mentioned this issue Jan 7, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
VB -> C# Specific to VB -> C# conversion
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant