Benjamin Charais
04/01/2019, 8:23 PMJakub Aniola
04/02/2019, 12:49 PMkotlinc main.kt -include-runtime -d main.jar
And execute
java -jar main.jar args
But how to include another jar in it? I am using kotlinx.coroutines and I want to using it while compiling in cliVenaseph
04/02/2019, 1:33 PMbbaldino
04/02/2019, 4:40 PMRtpSequenceNumber
is my inline class here, it wraps an Int
GarouDan
04/02/2019, 5:29 PMLeoColman
04/02/2019, 5:30 PMDico
04/02/2019, 5:32 PMpavel
04/02/2019, 7:19 PMSmallville7123
04/02/2019, 11:08 PMAlexjok
04/03/2019, 11:34 AMinline fun <reified T> execute(): T {
return doRequest()
}
private inline fun <reified T> doRequest(): T
{
//doSomething
}
Get the error "Public API inline function cannot access non public API"
How to solve it?spand
04/03/2019, 1:59 PMec
04/03/2019, 2:54 PMec
04/03/2019, 4:28 PMbogdoll
04/03/2019, 6:00 PMclass ThreadlocalDelegate<E>(initializer: ()->E) {
private val threadLocal = ThreadLocal.withInitial(initializer)
operator fun getValue(thisRef: Any?, property: KProperty<*>): E {
return threadLocal.get()
}
operator fun setValue(thisRef: Any?, property: KProperty<*>, value: E) {
threadLocal.set(value)
}
}
fun <E> threadlocal(initializer: ()->E) = ThreadlocalDelegate(initializer)
fun main() {
val sdf by threadlocal { SimpleDateFormat("yyyy-MM-dd HH:mm:ss").apply {
timeZone = TimeZone.getTimeZone("UTC")
}}
for(i in 0 until 10 ) {
thread {
println("${Thread.currentThread().name} - ${System.identityHashCode(sdf)}) - ${sdf.format(Date())}")
}
}
}
s1m0nw1
04/03/2019, 7:27 PMmvbrenes
04/03/2019, 9:55 PM.kt
files unless you go into edit mode.
I’m not sure how they prioritize their own issues but this one has been opened since June, maybe if we all go an upvote it they may get around to resolving this annoyance.
https://bitbucket.org/site/master/issues/16513/kotlin-syntax-highlighting-not-workingjiangxingbing
04/04/2019, 6:55 AMribesg
04/04/2019, 9:51 AMKProperty1<*, *>
?Artglorin
04/04/2019, 2:12 PMLuke
04/04/2019, 2:53 PMitems.forEach {
it.apply {
...
}
}
david-wg2
04/04/2019, 2:53 PMitems.onEach
?Erik Colban
04/04/2019, 6:03 PMLeoColman
04/05/2019, 4:46 AMghosalmartin
04/05/2019, 9:55 AMBruno_
04/05/2019, 11:37 AMamadeu01
04/05/2019, 12:03 PMCompanion object
does not exist on T
pablisco
04/05/2019, 4:26 PMhudsonb
04/05/2019, 5:03 PMcompanion object {}
in library classes to support extension?Andrew Gazelka
04/05/2019, 7:21 PMprintln("A")
.... however the non-suspending logging breakpoints each log TWICE per cycle (so in total the two breakpoints log FOUR times per cycle)...joeamrhein
04/05/2019, 8:14 PMmap
that skips over an item if it doesn't satisfy a conditional statement? For example:
data class Foo(val nullableName: String?)
data class Bar(val nonNullName: String)
val list: List<Foo> = fetchList()
list.map { item ->
if (item.nullableName != null) {
Bar(item.nullableName)
}
}
joeamrhein
04/05/2019, 8:14 PMmap
that skips over an item if it doesn't satisfy a conditional statement? For example:
data class Foo(val nullableName: String?)
data class Bar(val nonNullName: String)
val list: List<Foo> = fetchList()
list.map { item ->
if (item.nullableName != null) {
Bar(item.nullableName)
}
}
Kirill Zhukov
04/05/2019, 8:14 PMAlowaniak
04/05/2019, 8:16 PMlist.mapNonNull {
if (it.nullableName == null) null
else Bar(item.nullableName)
}
joeamrhein
04/05/2019, 8:16 PMzokipirlo
04/08/2019, 7:53 AMmapNonNull
. You get also IntelliJ hint 🙂