From java:
onView(withId(R.id.recyclerView)).perform(RecyclerViewActions.scrollTo(
hasDescendant(withText(artistResult.getNameVariations().get(0)))));
Trying to convert to Kotlin:
onView(withId(R.id.recyclerView)).perform(RecyclerViewActions.scrollTo(
hasDescendant(withText(artistResult.nameVariations[0]))))
我得到了这个堆栈跟踪:
Error:(63, 71) Type inference failed: Not enough information to infer parameter VH in fun <VH : RecyclerView.ViewHolder!> scrollTo(itemViewMatcher: Matcher<View!>!): RecyclerViewActions.PositionableRecyclerViewAction!
Please specify it explicitly.
I'm not entirely sure where I can specify "it" explicitly. When this has come up previously it's because I didn't initialise the value correctly, but here I'm calling a method. Any ideas?