package foo.bar; class X package foo.bar { fun foo() { package.foo.bar.X package.foo.bar.X() when (e) { is package.foo.bar.X #(x) -> {} } } }