Automatically Adapt By Name Parameters #17834
adamgfraser
started this conversation in
Feature Requests
Replies: 0 comments 2 replies
-
I didn't turn up an identical Scala 2 ticket in scala/bug. but I'll note scala/bug#9313 in passing anyway, since it's related in the sense that it's also about the (IMO) rather murky, semi-supported nature of by-name parameters to function values |
Beta Was this translation helpful? Give feedback.
0 replies
-
Cross-referencing proposal on Discourse: Make by-name parameters just sugar syntax rather than actual types |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently the code below does not compile.
printLine
takes a by name argument whereasflatMap
expects a function that takes an argument that is not by name. We can resolve the compilation error by replacingprintLine
withprintLine(_)
but it would be nice if the compiler allowed us to do this without the additional noise.Beta Was this translation helpful? Give feedback.
All reactions