is there a way to do this without making my own cl...
# announcements
b
is there a way to do this without making my own class?
Copy code
class LazyToString(val obj: () -> Any) {
    override fun toString(): String {
        return obj().toString()
    }
}

thing = LazyToString { doThing() }
r
thing by lazy { doThing().toString() }
b
can't because it's given to an operator that extects Any and then calls toString if it's just Object
(it's Map<String, Object>, used by gradle)