aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-11-28 11:51:54 +0100
committerLinnea Gräf <nea@nea.moe>2024-11-28 11:51:54 +0100
commitdb633c02b9a9d6da8a95edaceba37aefc9f511d2 (patch)
tree4806e601eb35dfc32b94ec8f46f1a89f2e84fb74
parentf0c4ac330ab714e73a60dfdce25071a9e1f999e7 (diff)
downloadreproduction-infinite-compile-db633c02b9a9d6da8a95edaceba37aefc9f511d2.tar.gz
reproduction-infinite-compile-db633c02b9a9d6da8a95edaceba37aefc9f511d2.tar.bz2
reproduction-infinite-compile-db633c02b9a9d6da8a95edaceba37aefc9f511d2.zip
Remove even more elements
-rw-r--r--src/main/kotlin/moe/nea/firm/EnumRenderer.kt8
-rw-r--r--src/main/kotlin/moe/nea/firm/ManagedConfig.kt8
-rw-r--r--src/main/kotlin/moe/nea/firm/ManagedOption.kt10
-rw-r--r--src/main/kotlin/moe/nea/firm/User.kt19
4 files changed, 4 insertions, 41 deletions
diff --git a/src/main/kotlin/moe/nea/firm/EnumRenderer.kt b/src/main/kotlin/moe/nea/firm/EnumRenderer.kt
index 3ffd6d3..03f5f95 100644
--- a/src/main/kotlin/moe/nea/firm/EnumRenderer.kt
+++ b/src/main/kotlin/moe/nea/firm/EnumRenderer.kt
@@ -1,13 +1,7 @@
package moe.nea.firm
interface EnumRenderer<E: Any> {
- fun getName(option: ManagedOption<E>, value: E): String
companion object {
- fun <E: Enum<E>> default() = object: EnumRenderer<E> {
- override fun getName(option: ManagedOption<E>, value: E): String {
- return value.name.lowercase()
- }
-
- }
+ fun <E: Enum<E>> default() = object: EnumRenderer<E> {}
}
} \ No newline at end of file
diff --git a/src/main/kotlin/moe/nea/firm/ManagedConfig.kt b/src/main/kotlin/moe/nea/firm/ManagedConfig.kt
index 0c2b8b4..741d6aa 100644
--- a/src/main/kotlin/moe/nea/firm/ManagedConfig.kt
+++ b/src/main/kotlin/moe/nea/firm/ManagedConfig.kt
@@ -4,16 +4,14 @@ import ext.StringIdentifiable
import kotlin.enums.enumEntries
-abstract class ManagedConfig(val identifier: String) {
+abstract class ManagedConfig {
protected fun <E : Any> choice(
codec: Codec<E>,
renderer: EnumRenderer<E>,
- ): ManagedOption<E> {
- return TODO()
- }
+ ) {}
protected inline fun <reified E> choice(
- ): ManagedOption<E> where E : Enum<E>, E : StringIdentifiable {
+ ) where E : Enum<E>, E : StringIdentifiable {
return choice(
StringIdentifiable.createCodec { enumValues<E>() },
EnumRenderer.default(),
diff --git a/src/main/kotlin/moe/nea/firm/ManagedOption.kt b/src/main/kotlin/moe/nea/firm/ManagedOption.kt
deleted file mode 100644
index d51d693..0000000
--- a/src/main/kotlin/moe/nea/firm/ManagedOption.kt
+++ /dev/null
@@ -1,10 +0,0 @@
-package moe.nea.firm
-
-import kotlin.properties.ReadOnlyProperty
-import kotlin.reflect.KProperty
-
-class ManagedOption<T : Any> : ReadOnlyProperty<Any?, T> {
- override fun getValue(thisRef: Any?, property: KProperty<*>): T {
- return TODO()
- }
-}
diff --git a/src/main/kotlin/moe/nea/firm/User.kt b/src/main/kotlin/moe/nea/firm/User.kt
deleted file mode 100644
index 080f93a..0000000
--- a/src/main/kotlin/moe/nea/firm/User.kt
+++ /dev/null
@@ -1,19 +0,0 @@
-package moe.nea.firm
-
-import ext.StringIdentifiable
-import kotlin.enums.enumEntries
-
-object User : ManagedConfig("test") {
- val option by choice<TestEnum>()
- val optionAlt by choice<TestEnum>(enumEntries<TestEnum>(),
- StringIdentifiable.createCodec { enumValues<TestEnum>() },
- EnumRenderable.default(),
- )
-
- enum class TestEnum : StringIdentifiable {
- A, B, C;
- }
-}
-fun main() {
- User.option
-}