dmitry.petrov
02/02/2016, 10:04 AMadd
, as you did above, both Kotlin and Java behave exactly the same.
If you define a generic Java version with proper wildcards (List<? extends T>
and so on), both Java and Kotlin behave counter-intuitively (because of variance).
Problem is that we have an ambiguous +
that applies both to (container, container) and to (container, element).
This issue was addressed in 1.0 RC (see @yole comments about plusElement
above).