Closed gafter closed 9 years ago
Here is a test for this
Imports System.Console ' works
Imports A.B ' does not work
Public Class A
Dim x1, x2, x3 As New X()
Public Overrides Function ToString() As String
Dim x4, x5, x6 As New X()
Return $"{x1} {x2} {x3} {x4} {x5} {x6}"
End Function
End Class
Public Class X
Dim value As Integer
Public Sub New()
Me.value = NextValue()
End Sub
Shared Function NextValue()
Static [next] As Integer
Return Threading.Interlocked.Increment([next])
End Function
Public Overrides Function ToString() As String
Return value.ToString()
End Function
End Class
Module Module1
Sub Main()
Dim a = New A
Console.WriteLine(a.ToString())
End Sub
End Module
It appears to work as intended in VS2015 RTM.
declarations such as:
only creates an instance for bw4 and not its predecessors
[@gafter: I believe this problem occurs for field declarations]
[Migrated from TFS/DevDiv 1197285]