arguments<T> method

T? arguments<T>()

Retrieves arguments cast to a specific type T, or null if type mismatch.

Implementation

T? arguments<T>() => switch (args) {
  T t => t,
  _ => null,
};