Errors when compiling AKKA code under 2.7.7
I am a very new bie for scala. So I download the source code AKKA and install the plugin for ec开发者_StackOverflow中文版lipse (2.7.7 final). When I open the project, it shows 29 compile errors. I know it may be version mismatch or plugin setting issue. But I don't know how to trouble shoot it.
a) ')' expected but '=' found.:
case class HotSwap(code: ActorRef ⇒ Actor.Receive, discardOld: Boolean = true)
b) identifier expected but 'object' found.
package object actor
Can anyone help this simple question?
Thanks a lot:)
UPDATE:
A similiar question is asked by jilen.
How to add sbteclipse plugin to SBT 0.10.x
Default parameters do not exist in Scala 2.7.
You can fake them (sometimes sanely) though:
// Note no "= true" which specified the default value
case class HotSwap(code: Any, discardOld: Boolean)
object HotSwap {
def apply(code: Any): HotSwap = HotSwap(code, true)
}
>> defined class HotSwap
>> defined module HotSwap
HotSwap("x")
>> res1: HotSwap = HotSwap(x,true)
HotSwap("x",false)
>> res2: HotSwap = HotSwap(x,false)
The second set of errors is because Package Objects were also introduced in Scala 2.8. I have never dealt with them, though. "Fixing" this likely requires a good bit more work on updating references, but see previous.
Happy coding.
The newest akka version builds only with scala 2.9. Is it possibly for you to use this version? It would save you a lot of trouble.
精彩评论