It seems the stability of Kotlin code analysis in the IDE has regressed a lot in 1.5.0-M2, at least in Android Studio Arctic Fox Canary 12.
I reported what first seemed a small issue, but as I'm using it, I see more and more problems that I didn't have before, so I commented twice int hat same issue already. I'm not going to report separate issues for every single problem I see in that area today because it looks like I could spend my day and my night on that, and I have work to do, but hopefully this issue reports, my comments and any subsequent discussions can help find the root cause(s).
https://youtrack.jetbrains.com/issue/KT-45864