How to use scala type lambda -


with following code,

val x: ({type x[y] = function1[y, unit]})#x = (y: int) =>println(y) 

it compiles, how use it? when call x(1)

an compiling occurs complains type mismatch, y expected: y accutal: int

you can't have value of type ({type x[y] = function1[y, unit]})#x, can't have value of type option or function1. thing can apply parameter, or use type argument type/method, apply parameters.


Comments

Popular posts from this blog

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

jsf - "PropertyNotWritableException: Illegal Syntax for Set Operation" error when setting value in bean -

arrays - Algorithm to find ideal starting spot in a circle -