It seems as I have caught something like a bug in Scala compiler. It is thrown both in 2.10.3 and 2.10.4-RC1.
Just try to compile attached file 'Monads.scala'.
In my environment it throws:
unhandled exception while transforming Monads.scala
[error] uncaught exception during compilation: java.lang.IllegalArgumentException
[trace] Stack trace suppressed: run last compile:compile for the full output.
[error] (compile:compile) java.lang.IllegalArgumentException: Could not find proxy for ma: Object in List(value ma, method flatMap, class Monad$class, object Monads, package <empty>, package <root>) (currentOwner= method apply )
Full stack trace is shown there:
Sorry, if it is something known already or my own mistake. Thanks.