eygraber
fun <T> foo() { object : Bar { override fun baz(foobar: Any?) { (foobar as? T)?.let {} } } }