From 04fc8589d308a6dc254d13b20079a69e1aafcb93 Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Wed, 4 Dec 2024 17:50:08 +0100 Subject: Add kotlin alternative (which works / at least does not infinite compile) --- src/main/java/ext/JavaHelper.java | 3 ++- src/main/kotlin/moe/nea/firm/ManagedConfig.kt | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/ext/JavaHelper.java b/src/main/java/ext/JavaHelper.java index 98f281b..637aabb 100644 --- a/src/main/java/ext/JavaHelper.java +++ b/src/main/java/ext/JavaHelper.java @@ -1,9 +1,10 @@ package ext; import moe.nea.firm.InterfaceA; +import moe.nea.firm.InterfaceC; public interface JavaHelper { - static InterfaceA createInterfaceA() { + static InterfaceA createInterfaceA() { return null; } } diff --git a/src/main/kotlin/moe/nea/firm/ManagedConfig.kt b/src/main/kotlin/moe/nea/firm/ManagedConfig.kt index 35f6a9d..64b04d3 100644 --- a/src/main/kotlin/moe/nea/firm/ManagedConfig.kt +++ b/src/main/kotlin/moe/nea/firm/ManagedConfig.kt @@ -9,13 +9,16 @@ interface InterfaceB { } interface InterfaceA +interface InterfaceC + +fun createInterfaceAKotlin():InterfaceA = TODO() fun funA( intA: InterfaceA, intB: InterfaceB, ) {} -fun funB() where E : Enum, E : JavaHelper { +fun funB() where E : Enum, E : InterfaceC { funA( JavaHelper.createInterfaceA(), InterfaceB.default(), -- cgit