Updated to Kotlin M6.1: toArray → copyToArray