// !CHECK_TYPE // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER class Outer { inner class Inner { fun instance() = this@Outer fun foo(): E = null!! fun bar(e: E, f: F) {} fun baz(): F = null!! fun act() { foo().checkType { _() } outerE().checkType { _() } instance().checkType { _>() } instance().outerE().checkType { _() } bar(foo(), baz()) bar(outerE(), baz()) bar(instance().outerE(), baz()) bar(topLevel().Inner().baz(), topLevel().Inner().baz()) bar(topLevel().Inner().foo(), topLevel().Inner().baz()) setE(foo()) } } fun outerE(): E = null!! fun setE(e: E) {} fun setInner(inner: Inner) {} } fun topLevel(): Outer = null!! fun foo() { val strInt: Outer.Inner = Outer().Inner() strInt.foo().checkType { _() } strInt.baz().checkType { _() } strInt.instance().setE("") strInt.instance().outerE().checkType { _() } strInt.instance().Inner().checkType { _.Inner>() } Outer().setInner(strInt) Outer().setInner(strInt) }