run<R> method

R run<R>(
  1. R callback<U>()
)

Run callback, passing this type as a type parameter.

Depending on the static type of the variable containing this RuntimeType, the return type of this function might require values to be casted. The values returned by this function will have the type as they are constructed in the callback, so casting is safe even with generic types.

Implementation

R run<R>(R Function<U>() callback) => callback<T>();