I have the following worksheet example:
import $dep.`com.softwaremill.macwire::util:2.5.8`
import $dep.`com.softwaremill.macwire::macros:2.5.8`
import com.softwaremill.macwire.wire
class Berry(var name: String)
case class Basket(berry: Berry)
lazy val blackberry: Berry = Berry("blackberry")
val basket: Basket = {
lazy val raspberry: Berry = Berry("raspberry")
wire[Basket]
}
println(basket.berry.name) // blackberry
The readme states:
first it tries to find a unique value declared as a value in the current block
My understanding of this would be that the used instance should be the raspberry.
Could someone pls explain this to me?
Thanks