Andrew Gazelka
07/19/2019, 5:40 AMAny extend Unit? This would be nice for overriding functions…PHondogo
07/19/2019, 6:35 AMkarelpeeters
07/19/2019, 7:31 AMUnit doesn't really mean void, instead all functions actually return the single Unit object.karelpeeters
07/19/2019, 7:32 AMAny extending Unit doesn't really make sense, since Unit is just an ordinary class.Dico
07/19/2019, 8:09 AMPHondogo
07/19/2019, 8:18 AMPHondogo
07/19/2019, 8:19 AMkarelpeeters
07/19/2019, 8:22 AMinterface Test {
fun foo()
}
class MyTest: Test {
fun bar() = 5
override fun foo() = bar()
}
Or be able to pass a () -> String to something expecting () -> Unit. The JVM bytecode could still be generated the same way, so no performance impact.PHondogo
07/19/2019, 8:37 AMPHondogo
07/19/2019, 8:38 AMPHondogo
07/19/2019, 8:39 AMDico
07/19/2019, 9:07 AMx is Unit will always be true then so introducing such mechanism would be backward incompatiblekarelpeeters
07/19/2019, 6:06 PMkarelpeeters
07/19/2019, 6:07 PM::foo because it happens to return something.