orangy
03/08/2017, 7:53 PMuser
03/09/2017, 7:44 AMmg6maciej
03/09/2017, 7:46 AMbrianwernick
03/09/2017, 3:58 PMuli
03/10/2017, 4:22 PMfun sumNumbers(vararg numbers: Int): Int {
return numbers[1]
}
val numbers = intArrayOf(2, 3, 4)
val sum = sumNumbers(*numbers)
i decompiled the kotlin byte code and found, that the spread operator generates a copy of the numbers array:
sum = sumNumbers(Arrays.copyOf(numbers, numbers.length));
Is that on purpose? Does it make sense?xenomachina
03/10/2017, 6:53 PMdanko9
03/11/2017, 12:33 AMmarcinmoskala
03/11/2017, 9:01 PMDmitry Kandalov
03/12/2017, 8:31 PMas
with imports if names are clashing.noctarius
03/13/2017, 8:26 AMenum NewBoolean {
Fact,
AlternativeFact
}
danko9
03/13/2017, 4:16 PMmatoelorriaga
03/13/2017, 8:38 PMmatoelorriaga
03/13/2017, 8:51 PMpierrelucveilleux
03/13/2017, 9:10 PMmg6maciej
03/14/2017, 9:03 AMkotlin.Enum
as empty companion object?miha-x64
03/14/2017, 1:51 PMvoddan
03/14/2017, 5:00 PMgetHeader
has no annotations, so its type should be String!
jlleitschuh
03/14/2017, 6:07 PMwalmyrcarvalho
03/14/2017, 6:10 PMjrenner
03/14/2017, 6:17 PMkevinherron
03/14/2017, 7:59 PMcompileTestKotlin
block too it seemskefir
03/14/2017, 8:02 PMkefir
03/14/2017, 8:11 PMenighma
03/14/2017, 8:53 PMmg6maciej
03/14/2017, 11:29 PMlinear
03/14/2017, 11:32 PMdouglarek
03/15/2017, 8:11 AMT
just use another E
: public <E> E a(Class<E> k){ ... }
?douglarek
03/15/2017, 9:19 AMclass A<T> {
public <E> E get(Class<E> klass, String key) {
return (E) (new Object()); // just for demo
}
public static void main(String[] args) {
A a = new A<>();
a.get(List.class,"a");
}
serj
03/15/2017, 10:49 AMfrank
03/15/2017, 10:49 AMfrank
03/15/2017, 10:49 AMserj
03/15/2017, 10:52 AM