aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-11-27 00:20:38 +0100
committerLinnea Gräf <nea@nea.moe>2024-11-27 00:20:38 +0100
commitf0c4ac330ab714e73a60dfdce25071a9e1f999e7 (patch)
tree2fe780e0bb22fcc563be3319840e1e8ed89ce4f1 /src/main
parent24a09e217c3a8c57756098e59420480afc8ab6f4 (diff)
downloadreproduction-infinite-compile-f0c4ac330ab714e73a60dfdce25071a9e1f999e7.tar.gz
reproduction-infinite-compile-f0c4ac330ab714e73a60dfdce25071a9e1f999e7.tar.bz2
reproduction-infinite-compile-f0c4ac330ab714e73a60dfdce25071a9e1f999e7.zip
Remove some more args
Diffstat (limited to 'src/main')
-rw-r--r--src/main/kotlin/moe/nea/firm/ManagedConfig.kt20
-rw-r--r--src/main/kotlin/moe/nea/firm/User.kt9
2 files changed, 6 insertions, 23 deletions
diff --git a/src/main/kotlin/moe/nea/firm/ManagedConfig.kt b/src/main/kotlin/moe/nea/firm/ManagedConfig.kt
index 87d35cc..0c2b8b4 100644
--- a/src/main/kotlin/moe/nea/firm/ManagedConfig.kt
+++ b/src/main/kotlin/moe/nea/firm/ManagedConfig.kt
@@ -5,36 +5,18 @@ import kotlin.enums.enumEntries
abstract class ManagedConfig(val identifier: String) {
- protected fun <T : Any> option(
- propertyName: String,
- default: () -> T,
-// handler: OptionHandler<T>
- ): ManagedOption<T> {
- return TODO()
- }
-
protected fun <E : Any> choice(
- propertyName: String,
- universe: List<E>,
codec: Codec<E>,
renderer: EnumRenderer<E>,
- default: () -> E
): ManagedOption<E> {
- return option(propertyName, default,
-// ChoiceHandler(universe, codec, renderer)
- )
+ return TODO()
}
protected inline fun <reified E> choice(
- propertyName: String,
- noinline default: () -> E
): ManagedOption<E> where E : Enum<E>, E : StringIdentifiable {
return choice(
- propertyName,
- enumEntries<E>().toList(),
StringIdentifiable.createCodec { enumValues<E>() },
EnumRenderer.default(),
- default
)
}
}
diff --git a/src/main/kotlin/moe/nea/firm/User.kt b/src/main/kotlin/moe/nea/firm/User.kt
index 09b0b73..080f93a 100644
--- a/src/main/kotlin/moe/nea/firm/User.kt
+++ b/src/main/kotlin/moe/nea/firm/User.kt
@@ -4,10 +4,11 @@ import ext.StringIdentifiable
import kotlin.enums.enumEntries
object User : ManagedConfig("test") {
- val option by choice("name") { TestEnum.A }
- val optionAlt by choice("name", enumEntries<TestEnum>(),
+ val option by choice<TestEnum>()
+ val optionAlt by choice<TestEnum>(enumEntries<TestEnum>(),
StringIdentifiable.createCodec { enumValues<TestEnum>() },
- EnumRenderer.default<TestEnum>()) { TestEnum.A }
+ EnumRenderable.default(),
+ )
enum class TestEnum : StringIdentifiable {
A, B, C;
@@ -15,4 +16,4 @@ object User : ManagedConfig("test") {
}
fun main() {
User.option
-} \ No newline at end of file
+}