diff options
author | Linnea Gräf <nea@nea.moe> | 2024-11-28 13:39:58 +0100 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-11-28 13:39:58 +0100 |
commit | d97658e317ced0bc0b73af1989e86ce5a5577221 (patch) | |
tree | c0f7924b93730a33e0a5931ae7c922de1e754b3b | |
parent | 1f5c7503af2fdda10da99f9637046a7880e30b0f (diff) | |
download | reproduction-infinite-compile-d97658e317ced0bc0b73af1989e86ce5a5577221.tar.gz reproduction-infinite-compile-d97658e317ced0bc0b73af1989e86ce5a5577221.tar.bz2 reproduction-infinite-compile-d97658e317ced0bc0b73af1989e86ce5a5577221.zip |
Minimize even more
-rw-r--r-- | src/main/java/ext/JavaHelper.java | 12 | ||||
-rw-r--r-- | src/main/java/ext/StringIdentifiable.java | 12 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firm/ManagedConfig.kt | 31 |
3 files changed, 25 insertions, 30 deletions
diff --git a/src/main/java/ext/JavaHelper.java b/src/main/java/ext/JavaHelper.java new file mode 100644 index 0000000..3ab41d1 --- /dev/null +++ b/src/main/java/ext/JavaHelper.java @@ -0,0 +1,12 @@ +package ext; + +import moe.nea.firm.InterfaceA; + +import java.util.function.Supplier; + +public interface JavaHelper { + static <E extends JavaHelper> InterfaceA<E> createInterfaceA(Supplier<E[]> supplier) { + return null; + } +} + diff --git a/src/main/java/ext/StringIdentifiable.java b/src/main/java/ext/StringIdentifiable.java deleted file mode 100644 index cc11c64..0000000 --- a/src/main/java/ext/StringIdentifiable.java +++ /dev/null @@ -1,12 +0,0 @@ -package ext; - -import moe.nea.firm.Codec; - -import java.util.function.Supplier; - -public interface StringIdentifiable { - static <E extends StringIdentifiable> Codec<E> createCodec(Supplier<E[]> supplier) { - return null; - } -} - diff --git a/src/main/kotlin/moe/nea/firm/ManagedConfig.kt b/src/main/kotlin/moe/nea/firm/ManagedConfig.kt index 0bf0e84..9c08aaf 100644 --- a/src/main/kotlin/moe/nea/firm/ManagedConfig.kt +++ b/src/main/kotlin/moe/nea/firm/ManagedConfig.kt @@ -1,28 +1,23 @@ package moe.nea.firm -import ext.StringIdentifiable +import ext.JavaHelper -interface EnumRenderer<E: Any> { +interface EnumRenderer<E : Any> { companion object { - fun <E: Enum<E>> default() = object: EnumRenderer<E> {} + fun <E : Enum<E>> default() = object : EnumRenderer<E> {} } } -interface Codec<T> { +interface InterfaceA<T> {} -} - -abstract class ManagedConfig { - protected fun <E : Any> choice( - codec: Codec<E>, - renderer: EnumRenderer<E>, - ) {} +fun <E : Any> funA( + codec: InterfaceA<E>, + renderer: EnumRenderer<E>, +) {} - protected inline fun <reified E> choice( - ) where E : Enum<E>, E : StringIdentifiable { - return choice( - StringIdentifiable.createCodec { enumValues<E>() }, - EnumRenderer.default(), - ) - } +inline fun <reified E> choice() where E : Enum<E>, E : JavaHelper { + return funA( + JavaHelper.createInterfaceA { enumValues<E>() }, + EnumRenderer.default(), + ) } |