diff --git a/src/docs/asciidoc/kotlin.adoc b/src/docs/asciidoc/kotlin.adoc index bd703cad59..8ad7564cfc 100644 --- a/src/docs/asciidoc/kotlin.adoc +++ b/src/docs/asciidoc/kotlin.adoc @@ -256,9 +256,10 @@ This `beans()` function can then be used to register beans on your application c [source,kotlin] ---- -val context = GenericApplicationContext() -beans().invoke(context) -context.refresh() +val context = GenericApplicationContext().apply { + beans().invoke(this) + refresh() +} ---- [NOTE]