Please see following example (hint: CType != TryCast)
Visual BasicPublic Class Class1
Function Foo(value As Object) As Integer
Dim result As Integer
If (value IsNot Nothing) AndAlso (TypeOf value Is String) Then
'CRR0027
result = CType(value, String).Length
End If
Return result
End Function
End Class
CTyp e would produce a runtime exception if cast is not possible.
Hi Robert,
Let me take a moment and thank you for your valuable feedback! I have reproduced the issue and we are working on it.