Klitos Kyriacou
03/30/2023, 11:07 AM```fun interface Printer {
fun print()
}```
Its constructor will be created implicitly, and any code using thefunction reference will compile. For example:::Printer
documentsStorage.addPrinter(::Printer)
On this page, the
addPrinter
function is not mentioned anywhere. What would its parameter type be, and how would it be used?Youssef Shoaib [MOD]
03/30/2023, 11:18 AMfun DocumentsStorage.addPrinter(printer: (() -> Unit) -> Printer)
Not sure how useful it really is to be honest.ephemient
03/30/2023, 11:29 AMfun Printer(block: () -> Unit): Printer
that is the declaration ::Printer
was referencing previously, and the docs say that works with fun interface
and no additional function insteadKlitos Kyriacou
03/30/2023, 12:34 PM