`val instance by lazy { SomeClass() }`
# getting-started
d
val instance by lazy { SomeClass() }
s
I am still trying to understand it but I am getting the error.
Missing 'setValue(SomeClass, KProperty<*>, SomeClass)' method on delegate of type 'Lazy<SomeClass>'
The class is.
Copy code
class SomeClass(private val str: String) {

    var instance by lazy { SomeClass("hello") }
}
Ok. My mistake I had to set it to val and not var.
d
Yeah, I had it wrong initially, sorry
👍🏽 1