The following code immediately crashes the Visual Basic compiler in VS2005 (at least, for my environment: Windows 7):
Public Module foo
Public Function FUNC() As System.Int32
Static dict As Generic.Dictionary(Of Int32, Of String)
Return 0
End Function
End Module
Specifically, upon finishing the line that defines ‘dict’ (static, local dictionary). Now, I’ve learned to be skeptical of declaring bugs in a compiler (especially for such a simple set of code as the above), so I’m curious as to why this occurs. Obviously the inelegant crash is a limitation in VS2005, but does the crash occur due to an underlying issue with declaring a static, generic dictionary? As in, is this bad/illegitimate VB?
Just found the answer. The dictionary definition should be Generic.Dictionary(Of X, Y) rather than (Of X, Of Y).