Hamza
09/22/2018, 1:05 AMvaskir
09/22/2018, 6:21 AMvaskir
09/22/2018, 8:58 AM/** .. */
the only doc comments style available? It's too verbose for single-line comments, see for example https://github.com/google/iosched/blob/master/model/src/main/java/com/google/samples/apps/iosched/model/Session.ktSlackbot
09/22/2018, 6:06 PMmuralimohan962
09/22/2018, 6:20 PMmantono
09/22/2018, 7:59 PMredrield
09/23/2018, 10:21 PMredrield
09/23/2018, 10:21 PMtask.command.requiredSubsystems.asSequence().filter { msg.shouldStartDefault(it) }
.mapNotNull(Subsystem::defaultCommand).toList()
.forEach {
handle(Message.Start(it))
}
nwh
09/24/2018, 2:17 AMRamin
09/24/2018, 8:40 AMribesg
09/24/2018, 12:11 PMequals
implemented for an inline class, or do I have to do it? It seems obvious to me that it should be implemented, as easy as it is, but I would like to be sureelect
09/24/2018, 12:14 PMVec3
class where I retrieve components as
override var x: Float
get() = array[ofs]
set(value) = array.set(ofs, value)
Why from java getX()
returns Float
instead float
?paulex
09/24/2018, 1:06 PMrazvandragut
09/24/2018, 5:19 PMAndreas Sinz
09/24/2018, 8:32 PMclass Person private constructor(val name: String, val age: Int) : Individual {
//stuff
}
fun Person(name: String, age: Int): Person {
require(age >= 18)
return Person(name, age)
}
Shawn
09/24/2018, 10:00 PMmyMap.getOrPut(key) { arrayListOf() }.add(i)
Nikky
09/24/2018, 10:24 PMavolkmann
09/25/2018, 1:48 AMkarelpeeters
09/25/2018, 8:15 AMtypealias
and import
are very different, typealias
is only about the type, import
is the actual class but the classname can also happen to represent the type.Onur
09/25/2018, 11:00 AMoriginalContent2
contains 1 extra space after “ipsum” while originalContent
does not)?apatrida
09/25/2018, 11:06 AMkotless
? https://plugins.jetbrains.com/plugin/10886-kotless-plugin @Andrey Tarasenko @brk @guredd @tanvdkarelpeeters
09/25/2018, 12:21 PMkarelpeeters
09/25/2018, 12:52 PMChild<String>
is not in general a subtype of Parent<Any>
, go trough this page: https://kotlinlang.org/docs/reference/generics.htmlRuckus
09/25/2018, 7:26 PMmap[key] = map.getOrDefault(key, 0) + 1
jw
09/25/2018, 7:29 PMmap.compute(key) { k, v -> (v ?: 0) + 1 }
Casey Brooks
09/25/2018, 7:30 PMmap[key] = (map[key]?:0) + 1
jdemeulenaere
09/25/2018, 8:40 PMribesg
09/26/2018, 8:10 AMwhen
thing in 1.3 RC
is reformatted incorrectly by IDEA:
val value = when (val type = peek()) {
JsonToken.BOOLEAN -> nextBoolean()
JsonToken.NULL -> nextNull().let { null }
else -> throw Error("Unexpected type $type")
}
After auto-formatting:
val value = when (
val type = peek()) {
JsonToken.BOOLEAN -> nextBoolean()
JsonToken.NULL -> nextNull().let { null }
else -> throw Error("Unexpected type $type")
}
There is no matching option under the when
close in Code Style
. Is this a bug / missing feature?
It happens with both the old default IDEA style and the new one.Slackbot
09/26/2018, 10:49 AMRuckus
09/26/2018, 6:33 PMRuckus
09/26/2018, 6:33 PMSam
09/26/2018, 11:41 PMdata class Person( val age : Int )
fun main(args: Array<String>) {
"sample".printParameters( "string", Person(22 ) )
}
private inline fun <reified T, R> String.printParameters( value1 : T, value2 : R ) {
println( "$this $value1 $value2" )
when( this ) {
is T -> println( "Object is of type ${T::class.java}" )
else -> println( "Unknown type")
}
}