TryCast<T> extension

Non-throwing runtime cast for a nullable receiver.

on
  • T?

Methods

tryCast<U>() → U?

Available on T?, provided by the TryCast extension

Casts the receiver to U when its runtime type matches, otherwise returns null.