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
Post a Comment