https://kotlinlang.org logo
Title
d

df

02/03/2019, 7:43 PM
Hi there. I'm using reflection in order to get a methods parameter list. Unfortunately kotlin and java return different values for the same signature. a) is that on purpose b) is there a way to get the same results https://gist.github.com/dfreudenberger/d9f7e6aa7031aa106a14692223c3d1b8
a

alex

02/03/2019, 7:58 PM
I guess it's connected to list immutability and co-/contr variance by default. In Java generics are invariant, and to achieve co/contrvariance you need special syntax (extends/super). So I don't think it's a bug, it is intended behaviour
Try use MutableList, and I think you'll get same behaviour as in Java
d

df

02/03/2019, 8:03 PM
thanks. MutableList did the trick.
and your explanation made perfect sense