I am trying to filter a list based on a condition ...
# fp-in-kotlin
r
I am trying to filter a list based on a condition that a property inside the list is an enum type. But I get an error on the filter function
Copy code
Type inference failed. The value of the type parameter T should be mentioned in input types (argument types, receiver type or expected type). Try to specify it explicitly.
l
it.procedure.contains(LineBuildActivity.HOLD)
checks if your
List<Procedure>
contains
LineBuildActivity.HOLD
. Since
Procedure
is not the same type as
LineBuildActivity
, it always return false, which in turn makes your filter return an empty list