cast

inline fun <R> Flow<*>.cast(): Flow<R>(source)

Adapt this Flow to be a Flow<R>.

This Flow is wrapped as a Flow<R> which checks at run-time that each value event emitted by this Flow is also an instance of R.

At the collection time, if this Flow has any value that is not an instance of R, a ClassCastException will be thrown.