eygraber
05/03/2023, 6:13 PMinline fun <T1, T2, T3, T4, T5, T6, R> combine(
flow: Flow<T1>,
flow2: Flow<T2>,
flow3: Flow<T3>,
flow4: Flow<T4>,
flow5: Flow<T5>,
flow6: Flow<T6>,
crossinline transform: suspend (T1, T2, T3, T4, T5, T6) -> R
): Flow<R> = kotlinx.coroutines.flow.combine(flow, flow2, flow3, flow4, flow5, flow6) { args: Array<*> ->
transform(
args[0] as T1,
args[1] as T2,
args[2] as T3,
args[3] as T4,
args[4] as T5,
args[5] as T6
)
}
It violates CastNullableToNonNullableType
, but the generic parameters here could be nullable (and in fact I think they are because they're not * & Any
). Am I missing something here?Brais Gabin
05/03/2023, 7:05 PMT1
could be a nullable type. So we shouldn't say anything about that casting. It should only raise an issue if T1
is defined as T1 : Any
.Atul Gupta
05/03/2023, 7:48 PMeygraber
05/03/2023, 7:49 PMAtul Gupta
05/03/2023, 9:08 PMdetekt
on its edge 😒aluting_face:eygraber
05/03/2023, 9:11 PM