Need to full compile twice to resolve overload resolution

I posted this on scala-users last night, but after compiling with maven I see that the issue only applies to when Idea controls compilation. Also, I'm not going to post any code just yet as I would need to do much simplication for a test. And I'm guessing that once I simplifly the error will not occur. Anyways...

The first time I compile I get errors that some invocations of overloaded methods are ambiguous. If I simply recompile again (no code changes) the compilation error does not occur. If I compile the file with the overloaded method declarations and then the file that makes the calls the error returns. Only a full recompile clears it up.

I saw some posts earlier about module dependency issues. But that was Leda and I'm still on v11. Also this is all in one module and even in the same package.

Has anybody run into something like this?

-barry

4 comments
Comment actions Permalink

Oh, one more thing. I can recompile the caller file with no errors. Its only when I recompile the declaring file the error returns. Looking at the generated classes for the declaring package, they don't seem to change with or without the error.

0
Comment actions Permalink

Here's a much simpler problem, but not related to overloading.

I have the declaration:
.
  def on_estop(duration: Duration, no_repeat: Duration, tags: String*): StateAlertRuleF =
    on(state(emergency_stop), duration, no_repeat, (_: State) => "EStop detected for %s seconds.".format(duration.getStandardSeconds), tags :_*)
.


And the invocation:
.






  on_estop(duration = 30.seconds, no_repeat = 10.minutes, tags = "maintenance")
.






I get the error:
.






  error: not found: value duration
  on_estop(duration = 30.seconds, no_repeat = 10.minutes, tags = "maintenance")
.






But if I do a full recompile no more error. Then if I recompile the declaration file and the caller file the error is back.

I thunked all the way back to 05.901 and still have the problem.
0
Comment actions Permalink

More data. A ctrl-p on the caller of on_estop shows all the arguments in brackets -- as optional. Clearly they are not optional arguments.

0
Comment actions Permalink

And if I change the body of on_estop to be "= null" the error goes away, but ctrl-p still shows the arguments in brackets. Some really strange stuff going on here.

0

Please sign in to leave a comment.