TheDukerChip
03/24/2021, 4:04 PMpublic <T extends AbstractSomething & InterfaceSomething> ConcreteClass(manager T)
nanodeath
03/24/2021, 4:13 PMPHondogo
03/24/2021, 5:33 PMSumeet Parmar
03/24/2021, 8:51 PM6.8.3
, I’m getting nagged on kotlin 1.4.20
vs 1.4.30
— I’m going to downgrade to kotlin-1.4.20 everywhere, is there a better solution?therealbluepandabear
03/24/2021, 11:04 PMLukas K-G
03/25/2021, 5:45 AM@Deprecated(...)
in my Kotlin library but from a plain Java project, the deprecation is not shown. Is that a known issue or is there anything wrong with my setup? 🤔Michał Kalinowski
03/25/2021, 12:03 PMuser
03/25/2021, 1:13 PMjaqxues
03/25/2021, 2:27 PMIgor Akkerman
03/25/2021, 2:55 PMClass 'kotlin.reflect.KClass' is compiled by a pre-release version of Kotlin and cannot be loaded by this version of the compiler
I'm using Kotlin 1.5.0-M1 in the latest EAP of the IDE with Kotlin plugin targeting 1.5.0 turned on, the project is built using Gradle. `KClass`seems to be referenced correctly by the IDE as coming from the 1.5.0-M1 JAR.
Has anybody seen this error before?Marcin Wisniowski
03/26/2021, 12:25 AMwhen
statement, but it doesn't seem to work, the receiver does not register. How can I make this work?Mikhail Galanin
03/26/2021, 8:52 AMelect
03/26/2021, 12:25 PMVladimir Bondarev
03/26/2021, 1:06 PMKarlo Lozovina
03/26/2021, 2:54 PM!!
operator have any overhead, if the value is never null
? I'm guessing no, but still...TwoClocks
03/26/2021, 6:32 PMDuration
has no .between()
to get a duration between instances. which is fine... but once I include the java.time.Duration
all the nice kotlin extension functions like Int.inSeconds
can't be found. Am I just stuck w/ the java ones if I need between()
?Harry B
03/27/2021, 7:53 PM2021-03-27 19:53:03.556 [DefaultDispatcher-worker-1] ERROR Application - Unhandled exception caught for CoroutineName(call-handler)
kotlinx.coroutines.CoroutinesInternalError: Fatal exception in coroutines machinery for DispatchedContinuation[<http://Dispatchers.IO|Dispatchers.IO>, Continuation at io.ktor.server.engine.BaseApplicationResponse$respondWriteChannelContent$2$1.invokeSuspend(BaseApplicationResponse.kt:166)@4ed1ef02]. Please read KDoc to 'handleFatalException' method and report this incident to maintainers
at kotlinx.coroutines.DispatchedTask.handleFatalException$kotlinx_coroutines_core(DispatchedTask.kt:144)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:115)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class kotlinx.coroutines.CompletedExceptionally
at kotlinx.coroutines.CompletionStateKt.toState(CompletionState.kt:16)
at kotlinx.coroutines.CompletionStateKt.toState$default(CompletionState.kt:13)
at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:111)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
... 4 common frames omitted
When i run this function:
val ApplicationCall.accountPrincipal: AccountPrincipal? get() = authentication.principal<AccountPrincipal>()
fun ApplicationCall.user(): Account? = transaction<Account?> {
Account.find { (Accounts.id) eq accountPrincipal?.id }.firstOrNull()
}
TheMrCodes
03/28/2021, 9:37 AMjvmusin
03/28/2021, 11:46 AM@param
and @return
statements from documentation wherever it's possible and mention them explicitly in the description. Do you agree with it and do you really try to omit them or you still use a javadoc-like documentation?Eugen Martynov
03/28/2021, 8:11 PMzsperske
03/28/2021, 8:12 PMextension methods
just get converted to static methods by the compiler, how do they have access to private/internal fields of their parent class? Edit: Answered, they dont.LastExceed
03/29/2021, 6:22 AMmySequence.take(n + 1).last()
doesnt feel right to meMark Buikema
03/29/2021, 10:30 AMParam
. How do I define this?
abstract class Params
abstract class Parent {
abstract val paramsClass: Class<????> // should be a class that extends Params
}
class Subclass : Parent() {
override val paramsClass = MyParams::class.java
}
data class MyParams : Params()
user
03/29/2021, 2:03 PMNthily
03/29/2021, 2:06 PMLiad Mazor
03/29/2021, 5:25 PMkevinherron
03/29/2021, 8:24 PM/**
* Get the value of the OutputArguments Property, if it exists.
*
* @return the value of the OutputArguments Property, if it exists.
* @see MethodNodeProperties#OutputArguments
*/
@Nullable
public Argument[] getOutputArguments() {
return getProperty(MethodNodeProperties.OutputArguments).orElse(null);
}
Now in some Kotlin code that uses this library it is inferring the type to be Array<Argument?>?
instead of Array<Argument>?
as it did previously. So now what was once:
override fun getOutputArguments(): Array<Argument> = methodNode.outputArguments ?: emptyArray()
now won't compile unless it's changed to something like this:
override fun getOutputArguments(): Array<Argument> {
val outputArguments: Array<Argument>? =
methodNode.outputArguments as Array<Argument>?
return outputArguments ?: emptyArray()
}
seetha
03/29/2021, 9:28 PMarrow.fx.coroutines.Schedule
. Is there a way to get the number of attempt in the Either.catch
Either.catch{
retry(Schedule.exponential(250.milliseconds)) {
evalOn(IOPool) {
//do something
incrementMetricSuccess(attempt) -------> want to increment metric with the attempt it got successful
}
}
}.mapLeft {
incrementMetricSuccess(attempt) -------> want to increment metric with the attempt to fail
}
Hitender Pannu
03/30/2021, 8:28 AMMark
03/30/2021, 10:23 AMprivate fun interface MySam {
fun invoke()
companion object {
operator fun invoke(randomArg: String) = MySam { }
}
}
When invoking MySam("anything")
we get:
Exception in thread "main" java.lang.ClassCastException: MySam$Companion$invoke$1 cannot be cast to kotlin.jvm.functions.Function
UPDATE: workaround is to instead declare as an extension function of the companion object
:
private operator fun MySam.Companion.invoke(randomArg: Int) = MySam { }
UPDATE2: Another workaround is to change interface visibility to non-private, then it works. Is this expected behavior?
Try it out here: https://pl.kotl.in/OxBHwZAn5Mark
03/30/2021, 10:23 AMprivate fun interface MySam {
fun invoke()
companion object {
operator fun invoke(randomArg: String) = MySam { }
}
}
When invoking MySam("anything")
we get:
Exception in thread "main" java.lang.ClassCastException: MySam$Companion$invoke$1 cannot be cast to kotlin.jvm.functions.Function
UPDATE: workaround is to instead declare as an extension function of the companion object
:
private operator fun MySam.Companion.invoke(randomArg: Int) = MySam { }
UPDATE2: Another workaround is to change interface visibility to non-private, then it works. Is this expected behavior?
Try it out here: https://pl.kotl.in/OxBHwZAn5kqr
03/30/2021, 10:38 AMMark
03/30/2021, 10:39 AMkqr
03/30/2021, 10:57 AMTomasz Krakowiak
03/30/2021, 7:53 PM