Convert Boolean to generic type
In VB.NET 2010, how to return a boolean开发者_开发知识库 value as generic type without compile warning?
thanks! Michael
You could turn Options Strict Off
generic, you mean this?
Sub Main()
Console.WriteLine(blah(True).ToString)
Console.ReadLine()
End Sub
Public Function blah(Of t)(ByVal typ As t) As T
Return typ
End Function
精彩评论