I play with scala distributed actors. Very nice.
I have a server that performs incoming functions. For example, a customer has
object Tasks {
def foo = {Console.println("I am Foo")};
def bar = {Console.println("I am Bar");}
}
...
server ! Tasks.foo _
...
And the server can select them and execute with the actor code, for example
react {
case task:(()=>Unit) =>
task()
All this works fine (which is very cool), but I am amazed at the warning displayed scalacfor the server code:
warning: non variable type-argument Unit in type pattern is unchecked since it is eliminated by erasure
case task:(()=>Unit) =>
^
How can I clear this warning?
(I don’t quite understand the difference between the type Unitand the ()=>Unittype of functions with a null argument. Just an attempt to map task:Unitin reactwithout warning, but actually does not match incoming tasks.)
Using scala 2.7.5 on Debian with Sun Java6.