# Koin Compiler 1.2: Compile-Time Safety for ALL Koin DSL

DevFeed: [Koin Compiler 1.2: Compile-Time Safety for ALL Koin DSL](<https://devfeed.tech/articles/koin-compiler-1-2-compile-time-safety-for-all-koin-dsl-22973.md>)

Original publisher: [Read original article](<https://blog.insert-koin.io/koin-compiler-1-2-compile-time-safety-for-all-koin-dsl-4603787b9921?source=rss----925561f2ecdf---4>)

Author: Arnaud Giuliani

Published: 2026-09-10T12:01:01Z

Content type: release

Language: en

Sources: [Koin developers](<https://devfeed.tech/sources/koin-developers-medium.md>)

Topics: [koin](<https://devfeed.tech/topics/koin.md>)

Tags: [abi](<https://devfeed.tech/tags/abi.md>), [adapter](<https://devfeed.tech/tags/adapter.md>), [annotation](<https://devfeed.tech/tags/annotation.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [constructor](<https://devfeed.tech/tags/constructor.md>), [dependencies](<https://devfeed.tech/tags/dependencies.md>), [dependency-injection](<https://devfeed.tech/tags/dependency-injection.md>), [dsl](<https://devfeed.tech/tags/dsl.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [koin](<https://devfeed.tech/tags/koin.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-2](<https://devfeed.tech/tags/kotlin-2.md>), [kotlin-multiplatform](<https://devfeed.tech/tags/kotlin-multiplatform.md>), [ktor](<https://devfeed.tech/tags/ktor.md>), [lambda](<https://devfeed.tech/tags/lambda.md>), [module](<https://devfeed.tech/tags/module.md>), [modules](<https://devfeed.tech/tags/modules.md>), [plugin](<https://devfeed.tech/tags/plugin.md>), [runtime](<https://devfeed.tech/tags/runtime.md>), [safety](<https://devfeed.tech/tags/safety.md>), [validation](<https://devfeed.tech/tags/validation.md>)

## AI overview

Koin Compiler Plugin 1.2 extends compile-time dependency validation to the reified DSL, `singleOf` constructor DSL, and classic lambda DSL. It checks constructor parameters and qualifiers for constructor registrations; in lambda definitions it checks written `get()` calls but does not infer dependencies from arbitrary lambda code. It also recognizes additional binding and module-composition forms, relays definitions across multiple Gradle `implementation` hops, and validates Ktor `install(Koin)` and `KoinApplication.withConfiguration<T>()` entry points. Limits include no diagnostics for modules without a recognized application entry point, undetected cycles through classic lambda definitions, warnings for runtime-decided module sets, and requiring `@Provided` for runtime-loaded modules. Version 1.2.1 supports Kotlin 2.3.20-2.4.20 and requires Koin 4.2.0 or newer.

## Source excerpt

Hello, dear Koin community 👋 I'm happy to share that Koin Compiler Plugin 1.2 is out, with 1.2.1 already available as the latest patch. Developer mascott unboxing new Koin Features!TL;DR Compile-time validation now works on the Koin application you already have, where before 1.2 it only covered code written specifically for the compiler plugin. Koin DSL -- All now covered! All Koin DSL: the plugin's reified DSL, Koin's constructor DSL (singleOf(::T)), and the classic lambda DSL (single { Foo(get()) }). Across Gradle modules: definitions are now visible two or more implementation hops away. More entry points: Ktor's install(Koin) and KoinApplication.withConfiguration<T>(). One artifact for Kotlin 2.3.20 through 2.4.20. You get there with no migration to a new DSL, and nothing to rewrite. Let's go through what shipped. Covering now all Koin DSL Until now, compile-time safety only covered the plugin's own reified DSL, which means the two DSL styles you have most likely already written were invisible to it. val appModule = module { single<UserService>() // checked singleOf(::UserRepository) // not checked before 1.2 single { AnalyticsHelper(get()) } // not checked before 1.2 } Three ways to declare a definition, and only the first was validated. If your UserRepository needed a Database that no module provided, your build passed and Koin threw at runtime. In 1.2, all three are validated. The two DSL styles get there differently. For the constructor DSL, the referenced constructor's parameters become real requirements, exactly like single<T>(), and any named() qualifier you put on the registration is matched against the consumers that ask for it. The classic lambda DSL works differently. The plugin doesn't try to work out dependencies from free-form lambda code. What it validates instead are the get() calls you wrote inside the lambda, treated as ordinary resolution call sites. Before 1.2 those calls were skipped on purpose, because a hand-written get() is difficult to dis