In my scala worksheet test.sc I define :
import com.tradedata.VolatilityInstance
test.sc exists at src/main/scala
In location src/main/scala I define :
package com.tradedata
class VolatilityInstance(intervalLength: Int, volatility: Double, beginDate: String, endDate: String) {
override def toString: String = {
this.beginDate
}
}
The filename for this class is VolatilityData.scala
VolatilityData.scala
exists at level src/main/scala/com/tradedata
When I attempt to run the worksheet I receive error :
Error:(1, 16) object VolatilityInstance is not a member of package com.tradedata
import com.tradedata.VolatilityInstance
If i define a new Scala object :
import com.tradedata.VolatilityInstance
object Tester extends App {
}
Tester object runs without issue.
I've tried re-building the project, invalidating the caches and restarting IntelliJ but cannot fix.
Is this a bug with the Scala worksheet ? How to import other classes into the Scala worksheet ?