Join Slack
Powered by
how do I declare return type inside a closure? (th...
# announcements
i
iex
05/16/2019, 7:36 PM
how do I declare return type
inside
a closure? (this doesn't compile)
s
streetsofboston
05/16/2019, 7:37 PM
???
streetsofboston
05/16/2019, 7:38 PM
What do you like to accomplish?
i
iex
05/16/2019, 7:46 PM
type inference was failing and I wanted a not-so verbose solution
iex
05/16/2019, 7:46 PM
but managed to write something acceptable with an extension function
s
Stephan Schroeder
05/17/2019, 8:55 AM
try
Copy code
val closure: (Int)->Int = {a -> a*2 }
4
Views
Open in Slack
Previous
Next