@Deprecated("Object") object Obsolete { fun use() {} } class Another { @Deprecated("Object") companion object { fun use() {} } } fun first() { Another.use() } fun useObject() { Obsolete.use() val x = Obsolete } fun useCompanion() { val d = Another val x = Another.Companion Another.Companion.use() Another.use() }