g
But why?
s
So plus operator is concat
a
plus
Returns a list containing all elements of the original collection and then all elements of the given elements sequence.
plusElement
Returns a list containing all elements of the original collection and then the given element.
g
Yes... I understand how it happend. But it was postfactum, after type inference gave me
List<Any>
instead of
List<List<Int>>
. And I'd prefer to know exactly what's happening when I type it simple smile . I'm wondering if better names could have been used.
Check this. IDEA is clearly showing the same result type for both methods.
Could be a bug in IDE, right? I mean, the type is statically checkable here and it's not
List<List<Int>>
as it's shown.
a
It seems so. It works correctly when you extract variable and use intention action to set explicit type.