There seems to be a bug in Kotlin 2.5.0-Beta2: A var-variable is wrongly marked as not being modified in an init-block even though it is reassigned.
Not only in the UI but also in the gradle output.
In Kotlin 2.5.0-Beta1 the gradle output is fine, but the UI still warns about it.