Imports System
Imports System.Reflection
Imports System.Collections.Generic
Imports Microsoft.VisualBasic
Public Class Test
Public Shared Sub Main()
Dim d As New Dictionary(Of String, Test)
Dim constructed As Type = d.GetType()
DisplayTypeInfo(constructed)
Dim generic As Type = constructed.GetGenericTypeDefinition()
DisplayTypeInfo(generic)
End Sub
Private Shared Sub DisplayTypeInfo(ByVal t As Type)
Console.WriteLine(t.ToString())
Console.WriteLine(t.IsGenericTypeDefinition)
Console.WriteLine(t.IsGenericType)
Dim typeArguments As Type() = t.GetGenericArguments()
Console.WriteLine(typeArguments.Length & "):")
For Each tParam As Type In typeArguments
Console.WriteLine(tParam.ToString())
Next tParam
End Sub
End Class