From 014bcddc0a396f0c49378d8a2f1051368134698f Mon Sep 17 00:00:00 2001 From: Auxilor Date: Mon, 25 Apr 2022 20:16:36 +0100 Subject: [PATCH] Fixed problem with extension functinos --- .../willfp/eco/core/config/ConfigHelpers.kt | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/eco-api/src/main/kotlin/com/willfp/eco/core/config/ConfigHelpers.kt b/eco-api/src/main/kotlin/com/willfp/eco/core/config/ConfigHelpers.kt index 9628fbeb..2abf42dd 100644 --- a/eco-api/src/main/kotlin/com/willfp/eco/core/config/ConfigHelpers.kt +++ b/eco-api/src/main/kotlin/com/willfp/eco/core/config/ConfigHelpers.kt @@ -10,6 +10,17 @@ import com.willfp.eco.core.config.interfaces.Config class DSLConfig internal constructor(type: ConfigType) : TransientConfig(emptyMap(), type) { infix fun String.to(value: Any?) = set(this, value) + + /** + * Helper function to create configs with a kotlin DSL. + * + * Inherits the config type of the sub-builder. + * + * @param builder The builder. + * @return The config. + */ + fun config(builder: DSLConfig.() -> Unit): Config = + DSLConfig(type).apply(builder) } /** @@ -30,14 +41,3 @@ fun config(builder: DSLConfig.() -> Unit): Config = */ fun config(type: ConfigType, builder: DSLConfig.() -> Unit): Config = DSLConfig(type).apply(builder) - -/** - * Helper function to create configs with a kotlin DSL. - * - * Inherits the config type of the sub-builder. - * - * @param builder The builder. - * @return The config. - */ -fun DSLConfig.config(builder: DSLConfig.() -> Unit): Config = - DSLConfig(this.type).apply(builder)