I'm trying to access the name of a variable inside an iterator
listOf(someClassVariable, anotherClassVariable, yetAnotherClassVariable).forEach {
if (it.foo()) {
map.add(it, ::it.name)
}
}
but getting unsupported [references to variables aren't supported yet]
error at ::it.name
. Any ideas/workarounds?
Aucun commentaire:
Enregistrer un commentaire