cast<R> method

  1. @useResult
KtList<R> cast<R>()

Provides a view of this KtList as an list of R instances.

If this KtList only contains instances of R, all operations will work correctly. If any operation tries to access an element that is not an instance of R, the access will throw a TypeError instead.

Implementation

@useResult
KtList<R> cast<R>() => _CastKtList<T, R>(this);