Subject: [scala-user] Command pattern with parametrized return type and variance
Hello,

I have a (sealed) series of commands, each of which has a different return
type. The basic trait is a Command[R], where R is the return type.
There is then a command executor, which has a def execute[R](cmd:
Command[R]): R, and executes an action appropriate for a command using
pattern matching.
All works well until I add a variance annotation (+R) to the trait:

https://gist.github.com/1878718

Any ideas why? :)

Thanks,
Adam
(C)2011 mailinglist-archive.com