tryAs<T> method

T? tryAs<T>()

An extension version of misc.tryAs.

Note that extension methods cannot work on dynamic types, so the freestanding misc.tryAs function should be preferred for those cases.

Implementation

T? tryAs<T>() => misc.tryAs<T>(this);