Support noarg callable references in Kotlin beans DSL
Closes gh-23395
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -156,6 +156,7 @@ class BeanDefinitionDslTests {
|
||||
val beans = beans {
|
||||
bean<Bar>()
|
||||
bean(::baz)
|
||||
bean(::foo)
|
||||
}
|
||||
val context = GenericApplicationContext().apply {
|
||||
beans.initialize(this)
|
||||
@@ -205,3 +206,4 @@ class FooFoo(val name: String)
|
||||
class BarBar(val foos: Collection<Foo>)
|
||||
|
||||
fun baz(bar: Bar) = Baz(bar)
|
||||
fun foo() = Foo()
|
||||
|
||||
Reference in New Issue
Block a user