Has there ever been discussion about an annotation...
# language-evolution
e
Has there ever been discussion about an annotation to disallow trailing lambdas for a given function? For example
Copy code
fun handleClicks(
  onClick: () -> Unit,
  onLongClick: () -> Unit
)
loses context when called like
Copy code
handleClicks(
  onClick = {...}
) {
  ...
}
➕ 8
💡 5
w
Related, I'd definitely use an annotation that strongly suggests that a function should be called only using named parameters
p
Ugly solution:
Copy code
fun handleClicks(
  onClick: () -> Unit,
  onLongClick: () -> Unit,
  noLambda: Nothing? = null
)
m
e
🌟 4