I'm using an older version of scala 2.7.5
When i try to do computations like this,
var x = 100
var x = x%1000
I get a
error: recursive variable x needs type
Is there a work around? why do i get this error?
I'm using an older version of scala 2.7.5
When i try to do computations like this,
var x = 100
var x = x%1000
I get a
error: recursive variable x needs type
Is there a work around? why do i get this error?
For anyone still wondering, in this particular case Kim Stebel already wrote the correct solution.
If you just wanted to solve the type error for var x = x%1000 the solution would be simple like this: var x:Int = x%1000 (which equals to 0, because of the default int value of the JVM, this is a really weird recursive expression though)