Namespace GenericsTest Class Foo Public Function GetTypeName( t As T ) As String Return t.GetType().Name End Function End Class Class Bar Inherits Foo End Class Sub TestMain() ' クラス型の型パラメータ Dim a = New System.Collections.Generic.List a.Add( "test" ) a.Add( "123" ) UnitTest( "Generic ... type parameter is class", a[0] = "test" and a[1] = "123" ) ' 値型の型パラメータ Dim b = New System.Collections.Generic.List b.Add( 123 ) b.Add( 234 ) UnitTest( "Generic ... type parameter is value(byte)", b[0] = 123 and b[1] = 234 ) Dim c = New System.Collections.Generic.List c.Add( 123.456 ) c.Add( 456.789 ) UnitTest( "Generic ... type parameter is value(double)", c[0] = 123.456 and c[1] = 456.789 ) ' 型パラメータがクロスした場合 ' TODO: より多くのパターンで試す必要あり Dim bar = New Bar UnitTest( "Generic ... complex", bar.GetTypeName( New String() ) = "String" ) End Sub End Namespace GenericsTest.TestMain()