danko9
06/28/2017, 4:07 PMkirillrakhman
06/28/2017, 6:08 PMval list = mutableListOf<Foo>()
bar(*foo.toTypedArray())
joelpedraza
06/28/2017, 6:18 PMenleur
06/28/2017, 6:39 PMval isCool = fun(a: Int) = a > 0
val isCool = { a: Int -> a > 0 }
fun isCool(a: Int) = a > 0
are there any differences or pitfalls?skennedy
06/28/2017, 7:52 PMprivate companion object {}
vs public? i can seem to access everything regardlessorangy
karelpeeters
06/29/2017, 6:45 AMgildor
06/29/2017, 10:42 AMrun
in chain of callswilddev
06/29/2017, 6:28 PMString[][] table = {
{"a","b","c"},
{"d","e","f"},
{"g","h","i"},
{"j","k","l"},
};
Should I use arrayOf in every line?karelpeeters
06/29/2017, 9:57 PMeric
06/30/2017, 2:16 AMkschlesselmann
06/30/2017, 8:07 AM@Embeddable
data class RouterId(val routerId: String) {
init {
val octets = routerId.split(":")
if (octets.size != 6) {
throw IllegalArgumentException("$routerId does not consist of 6 octets")
}
for (octet in octets) {
Integer.parseInt(octet, 16)
}
}
override fun toString(): String {
return routerId
}
}
which now fails with
java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.text.StringsKt__StringsKt.split, parameter $receiver
at kotlin.text.StringsKt__StringsKt.split(Strings.kt) ~[kotlin-stdlib-1.1.3.jar:1.1.3]
at kotlin.text.StringsKt__StringsKt.split$default(Strings.kt:1153) ~[kotlin-stdlib-1.1.3.jar:1.1.3]
at domain.model.aircraft.RouterId.<init>(RouterId.kt:9) ~[main/:na]
....
during creation with JPA. In my build.gradle
I use
plugins {
id "org.jetbrains.kotlin.jvm" version "1.1.3"
id "org.jetbrains.kotlin.plugin.noarg" version "1.1.3"
id "org.jetbrains.kotlin.plugin.jpa" version "1.1.3"
id "org.springframework.boot" version "1.5.4.RELEASE"
}
any suggestions? The code runs fine using 1.1.2
.gildor
06/30/2017, 10:28 AMinit
block
interface MyInterface {
var a: String
}
class ClassA : MyInterface {
override var a = ""
}
Ian
06/30/2017, 4:21 PMgregd
06/30/2017, 5:43 PMlateinit
with by lazy { ... }
if it fits your caseeric
06/30/2017, 9:23 PMfun `[`() {}
won’t compile, though. I have found that forward slashes (/
), backslashes (\
), open brackets ([
), and closed brackets (]
) are not allowed in backticks.
Is this a bug in the documentation, or am I missing something?napperley
07/01/2017, 2:51 AMborisdamato
07/01/2017, 2:36 PMvkkoshelev
07/01/2017, 7:41 PMkarelpeeters
07/02/2017, 6:43 AM= messages[localizablePlugin]?.keys ?: throw IllegalArgumentException(...)
. See https://kotlinlang.org/docs/reference/null-safety.html for an explanation.misko
07/02/2017, 11:40 AMkarelpeeters
07/02/2017, 8:38 PMamorenew
07/03/2017, 3:03 AMharmony
07/03/2017, 12:09 PMDalinar
07/03/2017, 7:27 PMharmony
07/03/2017, 10:46 PMshivthepro
07/04/2017, 6:47 AMgregd
07/04/2017, 8:18 AMio.reactivex.Observable.*
which is huge) ? I usually try to import members separately. But I see that by default Android Studio switches automatically to *
if there are 2+ imports from the same classgregd
07/04/2017, 8:24 AMgregd
07/04/2017, 8:32 AM