[kotlin] Smart cast to 'Type' is impossible, because 'variable' is a mutable property that could have been changed by this time