icsharpcode / CodeConverter

Convert code from C# to VB.NET and vice versa using Roslyn
https://icsharpcode.github.io/CodeConverter/
MIT License
826 stars 216 forks source link

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

Open GrahamTheCoder opened 7 months ago

GrahamTheCoder commented 7 months ago

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