I'm porting a project of mine to Kotlin. I often receive errors of the form:
Smart cast to 'kotlin.Array<kotlin.Int>' is impossible, because 'offsets' is a member variable that can be changed from another thread
Because of this, I have
!! assertions in a lot of places that shouldn't need it, which I don't like. Is there any way to tell the compiler that I'm disciplined about threads surrounding a particular type or variable, or that my program is single-threaded, or something else to bypass this error? If my program has a race condition, nulls are the least of my problems.