https://kotlinlang.org logo
t

tevjef

12/10/2018, 7:41 PM
I'm curious why this works
fun a(): Unit
==
fun a()
but this doesn't:
fun b(G: Unit)
!=
fun b()
i

ian.shaun.thomas

12/10/2018, 7:42 PM
not entirely sure what you are asking but looks like you're missing the parameter for
b()
in the right hand unless you're making another point.
n

Nikky

02/09/2019, 6:14 AM
return type is implicit
Unit
when left out, but arguments of type
Unit
do not behave that way, oterwise you would have a ininite number of functions with any number of Unit parameters be equivalent to a single function, silly apart fro mthat its quite useless as a value to pass since there is just a single Unit, its like passing void..
2 Views