cdurham
08/10/2017, 5:09 PM@Deprecated
that can be auto-fixed by intelliJ?v79
08/10/2017, 7:27 PMif(bridgeName == null || bridgeName.isEmpty()) {
errors.put("add-search-name","Name must not be blank")
} else {
if(4 > bridgeName.length) {
}
works fine, but if I replace the if condition with if(bridgeName.isNullOrEmpty())
the name length check isn't null safe.ar-g
08/11/2017, 5:17 AMclass User(val name: String) {
var address: String = "unspecified"
set(value: String) {
println(address)//works
address = value//doesn't work
}
}
lovis
08/11/2017, 11:13 AMif(long.equals(int)) {
...
}
the IDE suggests to replace it with ==
, even though that doesn’t work 🙈mquigley
08/11/2017, 6:25 PM0xAABBCCDD_11223344L
cannot exist in Kotlin? Neither can the value of Long.MIN_VALUE
, which is actually represented by -9223372036854775807L - 1L
?gaurav9822
08/12/2017, 5:47 AMgp
08/13/2017, 4:00 AMrebcabin
08/13/2017, 4:11 PMcount()
versus size
for collections? Seems there are two ways to get the number of elements in a collection: count()
called without a predicate argument and size
, looks like a field, attribute, property. Any reason to prefer one over the other?jimn
08/14/2017, 6:11 AMarekolek
08/14/2017, 9:41 AMjk
08/14/2017, 2:08 PMmissingParamError
and incorrectPassword
, and what the similarity/differences between them are?bachhuberdesign
08/15/2017, 1:50 AMoverride inline fun <reified T> foo(key: String, value: T): T {
}
but it's not possible since you can't inline
an interface functionraul782
08/15/2017, 3:07 AMkarelpeeters
08/15/2017, 9:45 AMkarelpeeters
08/15/2017, 10:21 AMList
if you're going with forEach
.matthew
08/15/2017, 5:57 PMfold
maybe?oday
08/15/2017, 8:28 PMfirst
and second
by something custom?oday
08/16/2017, 8:14 AMmenegatti
08/16/2017, 9:53 AMdata.groupBy { it[0] }.mapValues { (_, value) -> value.map { it[1] } }
delater
08/17/2017, 9:38 AModay
08/17/2017, 1:26 PMdiesieben07
08/17/2017, 5:49 PMget
instead of the containsKey
, saves you one hash lookup as well.darkmoon_uk
08/17/2017, 10:06 PMmcscruff
08/18/2017, 12:17 AMJuan
08/18/2017, 4:16 AMtechie01
08/18/2017, 11:59 AMdathoang.se
08/20/2017, 8:21 AModay
08/20/2017, 8:40 PMbenleggiero
08/21/2017, 3:25 AMclass Foo(var values: MutableList<String>)
class Bar(var foo: Foo) {
fun bar() {
foo.values += "Baz"
}
}
benleggiero
08/21/2017, 4:16 AMclass Foo(val bars: Map<Int, Bar<*>>) {
fun <Baz> qux(baz: Baz) {
val bar2 = bars[2]!!
bar2.bazes += baz
}
interface Bar<Baz> {
var bazes: MutableList<Baz>
}
}