// IGNORE_BACKEND: JS fun interface Supplier { fun get(): SupplierTP } fun foo(t: FooTP): Supplier { return Supplier { t } as Supplier } // Let's do some enterprise-style programming shall we fun interface SupplierInvoker> { fun invokeSupplier(supplier: SupplierInvokerTP2): SupplierInvokerTP1 } fun > bar(): SupplierInvoker { return SupplierInvoker { supplier -> supplier.get() } as SupplierInvoker } fun box(): String { val result1 = foo("OK").get() if (result1 != "OK") return result1 val result2 = bar>().invokeSupplier { "OK" } if (result2 != "OK") return result2 return "OK" }