Hi,I have something like this in Scala:import com.messagessealed trait BasicMessage
case class GetIP() extends BasicMessageAnd I know that if I want to use GetIP from Java, I have to do something like:import com.messages.GetIP$;GetIP$.MODULE$However, Eclipse stay saying error on the import statement in the Java code. And so when I'm accesing to GetIP$ later on.I think it is a bug from Eclipse, and not from Scala-IDE, but is there anything that I can do? I'm using Eclipse 4.2Thanks!--
You received this message because you are subscribed to the Google Groups "Scala IDE User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-ide-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
sealed trait BasicMessage { def instance = this }
case object GetIP extends BasicMessage
viewActorCtx.parent().tell(GetIP.instance(), viewActorCtx.self());
Hi Mirco,Thank you very much for your response.What I'm trying to do is basically using akka for a demo.... I have an actor defined in Scala, and I'm passing its context to a java code
, and trying to send a message to its parent from the Java code,So, what you said works fine so far, just doing something like this in Scala:sealed trait BasicMessage { def instance = this }
case object GetIP extends BasicMessagethen I can send the message in Java as:viewActorCtx.parent().tell(GetIP.instance(), viewActorCtx.self());On that way I avoid the usage of the $, so far, so good.... But what if I have to send a message with parameters, so a case class?
If I do something like:viewActorCtx.parent().tell(new GetIP(), viewActorCtx.self());
it is not recognized by the match of the receiving actor (it goes into the "case _=>" instead)Why is that? On the other hand, if I use anyway as GetIP$.MODULE$ then it works fine (besides the problem with Eclipse that I commented before).
The code is actually correct, it compiles both with Maven and when I do a "clean all" -> "build".
It only causes problems when the Java code is incrementally recompiled.
--
You received this message because you are subscribed to the Google Groups "Scala IDE User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-ide-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scala-ide-user/adab2ecc-f8ae-4f1c-8b44-7d0a90611f27%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/scala-ide-user/f7dca35d-25b8-4692-9900-83b642c78c38%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.