elect
10/01/2021, 11:04 AMinterface WebhookEventInterface<T> {
operator fun invoke(block: WebhookEventInterface<T>.() -> Unit) {..}
}
in this way
interface PushPullRequestFeatures<T> : WebhookEventInterface<T> {
override operator fun invoke(block: PushPullRequestFeatures<T>.() -> Unit) {..}
}
Unfortunately I didn't find a way to successfully infer the new receiver on the lambda.
The above code does not override the super method:
'invoke' overrides nothingand there is also a platform clash:
Platform declaration clash: The following declarations have the same JVM signature (invoke(Lkyge/triggerEvents/PushPullRequestFeatures;Lkotlin/jvm/functions/Function1;)V):I've tried to use
@JvmName
, but it says:
I tried also'@JvmName' annotation is not applicable to this declaration
@OverloadResolutionByLambdaReturnType
by changing the return type, but the clash doesn't go away neither
Any idea?ephemient
10/01/2021, 6:01 PMval iface: WebhookEventInterface<T> = object : PushPullRequestFeatures<T> { … }
iface.invoke { // this: WebhookEventInterface<T> ->
elect
10/02/2021, 10:22 AM