Alowaniak
09/18/2018, 3:17 PMNikky
09/18/2018, 3:18 PMBrian Zhang
09/18/2018, 5:34 PMbeholder
09/19/2018, 5:23 AMcoder82
09/19/2018, 8:22 AMpp.amorim
09/19/2018, 9:51 AMerluxman
09/19/2018, 9:51 AMmyanmarking
09/19/2018, 11:37 AMShawn
09/19/2018, 3:38 PMtemp_man
09/19/2018, 5:27 PMrobin
09/19/2018, 6:08 PMfun <T> test(param: T) {
val clazz = param::class
}
And the compiler complains (rightly so) that param has a nullable type 'T'. It even suggests using !!
to make it non-nullable, but if I do that, the compiler still complains with the exact same message. Here are a few more variations I've tried, each one with the same error message:
val clazz = param!!::class
val clazz = param?.let { it::class }
val clazz = if (param != null) param::class else null
So, how am I supposed to get to the class of param
here? Is this a bug with type inference or am I missing something? Making T
reified or constrain it to Any
is not an option.pp.amorim
09/20/2018, 3:41 PMDominaezzz
09/20/2018, 5:11 PMArray
and {Int,Float,...}Array
implement Iterable
? I'm trying to write a method that can take either as input.Ruckus
09/20/2018, 6:38 PMsuspend fun main
always runBlocking
?tapchicoma
09/20/2018, 6:38 PMEven if you want to keep the old code style, please specify the kotlin.code.style=obsoleteWhat is the old code style?
Dominaezzz
09/20/2018, 6:40 PMHullaballoonatic
09/20/2018, 7:25 PMif foobool then
instead of if( foobool )
? i would enjoy it for when using if
and else
as a ternary operatorNikky
09/20/2018, 8:37 PMredrield
09/20/2018, 11:37 PM@CallSuper
lint outside of an android project using ktlint or something?Alexander Vasiljev
09/21/2018, 8:11 AMvaskir
09/21/2018, 8:12 AMvaskir
09/21/2018, 8:13 AMribesg
09/21/2018, 8:23 AMorangy
vaskir
09/21/2018, 8:42 AMfuture
function (builder?), now it seems gone:vaskir
09/21/2018, 8:42 AMNikky
09/21/2018, 5:02 PMPersion
a typo ?Nikky
09/21/2018, 5:09 PMcontract {
returns() implies (this@save is Person)
}
karelpeeters
09/21/2018, 8:41 PMpavel
09/21/2018, 10:00 PM