开发者

Convert Boolean to generic type

开发者 https://www.devze.com 2023-02-04 07:00 出处:网络
In VB.NET 2010, how to return a boolean开发者_开发知识库 value as generic type without compile warning?

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
0

精彩评论

暂无评论...
验证码 换一张
取 消