[O] Suppress unchecked cast
This commit is contained in:
@@ -32,8 +32,8 @@ internal class BluetoothHandler private constructor(context: Context) {
|
||||
|
||||
val listeners = HashMap<KClass<*>, MutableList<(Any) -> Unit>>()
|
||||
|
||||
inline fun <M : Any, reified D : IDecoder<M>> observe(crossinline cb: (M) -> Unit)
|
||||
{
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
inline fun <M : Any, reified D : IDecoder<M>> observe(crossinline cb: (M) -> Unit) {
|
||||
(listeners[D::class] ?: error("Cannot observe unknown decoder class ${D::class}"))
|
||||
.add { cb(it as M) }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user