When I have a function that expects a value of type
(A) -> B
, it’d be cool to be able to just pass
::foo
instead of
A::foo
. Is there a name for what I want? Even better, is there an existing ticket/proposal for it?
Example:
Copy code
data class A(val name: String)
fun <B> A.getProp(prop: (A) -> B) = prop(this)
fun A.getName() = getProp(::name) // I want this
fun A.getName2() = getProp(A::name) // But I have to do this instead