CodeConverter icon indicating copy to clipboard operation
CodeConverter copied to clipboard

VB -> C#: Byref optional parameters to New field initializer can throw nullref

Open GrahamTheCoder opened this issue 4 months ago • 0 comments

VB.Net input code

Public Class FieldInitializationTest
    Private First As New Inner()
    Private Second As New Outer(First)
End Class

Public Class Inner
End Class

Public Class Outer
    Sub New(inner As Inner, Optional ByRef x As String = "")
    End Sub
End Class

Erroneous output

Throws

Details

  • VS extension on master

GrahamTheCoder avatar Feb 24 '24 19:02 GrahamTheCoder