// !DIAGNOSTICS: -UNUSED_PARAMETER trait JPAEntityClass { fun T.findByName(s: String): D {null!!} } class Foo { class object : JPAEntityClass } fun main(args: Array) { with("", { Foo.findByName("") }) } fun with(t: T, f: T.() -> Unit) {}