Marcelo Hernandez

    Marcelo Hernandez

    1 month ago
    Let's say I want to forbid
    androidx.paging.compose.items
    using
    ForbiddenMethodCall
    instead of
    ForbiddenImport
    , what pattern would I have to use given the following signature:
    public fun <T : Any> LazyListScope.items(
        items: LazyPagingItems<T>,
        key: ((item: T) -> Any)? = null,
        itemContent: @Composable LazyItemScope.(value: T?) -> Unit
    )
    I tried the following but the rule is not triggering a violation:
    androidx.paging.compose.items(androidx.compose.foundation.lazy.LazyListScope, androidx.paging.compose.LazyPagingItems, kotlin.jvm.functions.Function1, kotlin.jvm.functions.Function2)
    Guess I was able to get away with just
    androidx.paging.compose.items
    b

    Brais Gabin

    1 month ago
    If that function is not overloaded I think that's the best solution. It's doable to match by parameters too but the signature of this function is really complex so it would be a complex one.