This looks to be the same issue as
KT-51243
I explained a workaround
here, but TL;DR: rewrite it to be this:
sealed interface TypeWrapper<out A> {
object IMPL: TypeWrapper<Nothing>
}
operator fun <T> T.invoke(action: context(T) (TypeWrapper<T>) -> Unit) {
action(this, TypeWrapper.IMPL)
}