https://kotlinlang.org logo
#getting-started
Title
# getting-started
p

poohbar

02/17/2021, 3:43 PM
If I have a variable:
Copy code
val block: () -> Any? = ...
is there a difference between calling:
Copy code
block()
and
Copy code
block.invoke()
?
🚫 2
m

mkrussel

02/17/2021, 3:44 PM
no
p

poohbar

02/17/2021, 3:47 PM
thanks
e

ephemient

02/17/2021, 3:53 PM
also if you have
Copy code
val block: Any.() -> Unit = {}
then
Copy code
foo.block()
block.invoke(Unit)
block(Unit)
are all equivalent