Kotlin issue “One type argument expected for class ExpandableRecyclerAdapter”

后端 未结 1 1309
我在风中等你
我在风中等你 2021-01-03 16:38

Got problems with RecyclerAdapter ViewHolder

abstract class ExpandableRecyclerAdapter(private         


        
相关标签:
1条回答
  • 2021-01-03 17:25

    Kotlin does not allow generic types to be specified without providing generics unless you're referring to a non-instance member of the class. (static inner classes, ::class, companion methods). Since ViewHolder is an inner class its identity depends on the exact specification of its outer class when talking about the type itself.

    This means you cannot refer to a generic ExpandableRecyclerAdapter.ViewHolder, you must specify the bounds in which the outer class lies as well. Changing it to ExpandableRecyclerAdapter<T>.ViewHolder should solve the issue.

    0 讨论(0)
提交回复
热议问题