Mikhail
07/21/2022, 7:53 PMephemient
07/21/2022, 7:57 PMephemient
07/21/2022, 7:58 PMMikhail
07/21/2022, 8:00 PM@JvmName
, TYSM!Mikhail
07/21/2022, 8:03 PM'@JvmName' annotation is not applicable to this declaration
And here is my code:
@Repository
interface WebhookRepository : JpaRepository<Webhook, WebhookId> {
@JvmName("findWebhookByName")
fun findWebhookByName(name: WebhookId): Optional<Webhook>
}
ephemient
07/21/2022, 8:03 PMephemient
07/21/2022, 8:03 PMMikhail
07/21/2022, 8:04 PMephemient
07/21/2022, 8:05 PM@Suppress
the error away, but you have to manually use the correct @JvmName
on every overload (otherwise you get missing methods at runtime… this is why it's a compiler error)Mikhail
07/21/2022, 8:05 PMephemient
07/21/2022, 8:06 PM@Repository
interface WebhookRepository : JpaRepository<Webhook, WebhookId> {
@Suppress("INAPPLICABLE_JVM_NAME")
@JvmName("findWebhookByName")
fun findWebhookByName(name: WebhookId): Optional<Webhook>
}
should be sufficientephemient
07/21/2022, 8:07 PM@Suppress("INAPPLICABLE_JVM_NAME") @JvmName("findWebhookByName")
to the overrideMikhail
07/21/2022, 8:11 PMMikhail
07/21/2022, 8:12 PMephemient
07/21/2022, 8:13 PMephemient
07/21/2022, 8:14 PMMikhail
07/21/2022, 8:14 PM