I have the following: `rects.sortWith(Comparator {...
# getting-started
e
I have the following:
rects.sortWith(Comparator { a, b -> ... })
and I'd like to declare
Comparator
somewhere else
k
elect: and what issue do you have?
e
I was writing when I found out
val rectHeightCompare = Comparator { a, b -> ... }
didn't have enough info about
T
I was inferring T before
<T> Comparator
it has to go after
Comparator<T>
m
You can write out the types on the lambda parameters. Like this, if they're ints:
rects.sortWith(Comparator { a: Int, b: Int -> ... })
e
ah, that makes sense too