diff options
author | Linnea Gräf <nea@nea.moe> | 2024-12-17 23:07:06 +0100 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-12-17 23:07:06 +0100 |
commit | a046b198645811fe1b7db129942505c379aabb03 (patch) | |
tree | d97e68b1cf3a272aec5d8dd863b82fb0c9b0dc82 /src/main/kotlin/moe/nea/ledger/utils/di/DIProvider.kt | |
parent | a2f73de90fb9c9d0ea7a5e7e9e6b9e445a8094ee (diff) | |
download | LocalTransactionLedger-a046b198645811fe1b7db129942505c379aabb03.tar.gz LocalTransactionLedger-a046b198645811fe1b7db129942505c379aabb03.tar.bz2 LocalTransactionLedger-a046b198645811fe1b7db129942505c379aabb03.zip |
Diffstat (limited to 'src/main/kotlin/moe/nea/ledger/utils/di/DIProvider.kt')
-rw-r--r-- | src/main/kotlin/moe/nea/ledger/utils/di/DIProvider.kt | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/main/kotlin/moe/nea/ledger/utils/di/DIProvider.kt b/src/main/kotlin/moe/nea/ledger/utils/di/DIProvider.kt index b5ce550..bd5b9ef 100644 --- a/src/main/kotlin/moe/nea/ledger/utils/di/DIProvider.kt +++ b/src/main/kotlin/moe/nea/ledger/utils/di/DIProvider.kt @@ -24,6 +24,7 @@ fun interface DIProvider<T : Any> : BaseDIProvider<T, Unit> { ?: clazz.constructors.find { it.parameterCount == 0 } ?: error("Could not find DI injection entrypoint for class $clazz")) as Constructor<out T> + // TODO: consider using unsafe init to inject the parameters *before* calling the constructor return DIProvider { di -> val typArgs = cons.parameters.map { di.provide(it.type, it) |