pniederw10/31/2017, 3:18 AM
rather than a
Marc Knaup10/31/2017, 11:54 AM
type I only get if I don’t create an anonymous subclass at the call site (i.e. in the
). I noticed however that the resulting
inline fun getKType
) has various issues: • You cannot get the
which was used to create the
so you have to store that info separately. • The
lacks nullability information. • The
doesn’t have star projection anymore (turns into
at runtime). •
itself isn’t generic and thus you lose compile-time safety when passing around `KType`s instead of `KClass`es. • I think `KType`’s implementation isn’t optimized that much for performance.
for example looks scary. •
or something similar to check whether two projections are compatible/assignable.
for the same reason. It doesn’t support some
classes and multiple upper/lower generic bounds since they’re all not relevant in my case.
pniederw10/31/2017, 6:04 PM
of the resulting
always contains “ERROR: …” for me. I was particularly interested in the nullability information, but as you said, it’s not there. kotlin-reflect feels a bit shaky and doesn’t seem quite there yet. also got lots of errors when debugging it.
Marc Knaup10/31/2017, 6:09 PM
is constructed from Java’s
since Java doesn’t have any info about nullability.
pniederw10/31/2017, 6:24 PM
, I constructed it using kotlin reflection. same thing.
Marc Knaup10/31/2017, 6:26 PM
allows you to specify nullability 😮
pniederw10/31/2017, 6:26 PM
Marc Knaup10/31/2017, 6:29 PM
pniederw10/31/2017, 6:32 PM
. why can’t it work for
seemed like the equivalent of
Marc Knaup10/31/2017, 6:36 PM
is mostly useless at the moment imo.
pniederw10/31/2017, 6:37 PM