variant try cast

This commit is contained in:
关倩倩 2019-03-30 14:33:58 +08:00
parent 55cce16b34
commit f90bd4530f
1 changed files with 4 additions and 0 deletions

View File

@ -75,6 +75,10 @@ Namespace Language
End Get
End Property
Public Function [TryCast](Of T)() As T
Return DirectCast(Value, T)
End Function
<MethodImpl(MethodImplOptions.AggressiveInlining)>
Public Overloads Shared Widening Operator CType(obj As [Variant](Of A, B)) As Type
Return obj.GetUnderlyingType