`::main` in line 4 gives a an overload resolution ...
# announcements
l
::main
in line 4 gives a an overload resolution ambiguity. I understand why it happens, but how do i resolve it? (i'd like to know the solution to both scenarios)
b
just specify a type for x
👍 1
Copy code
val main = 42

fun main() {
	val x: KProperty0<Int> = ::main 
}
should be ok
e
Using lambda is easy:
Copy code
val x = { main } // reference property
val x = { main() } // reference function