I have defined a type inside a package object as following in package.scala.
type Structure = List [(int, int)]
Now I want to use this Structure inside a class in abc.scala and get the elements of the list individually. abc.scala and package.scala are inside the same folder (src/utility).
class abc (d: Structure) {
val a = d._1
val b = d._2
...................
...................
}
It compiles, but I need to try a test inside another folder (test). I have imported the package utility in the test code as follows.
import utility._
class test {
val a = utility.Structure ((1, 2), (2, 5))
............................
............................
}
I am getting the following error:
object Structure is not a member of package src.utility.
Note: type Structure exists, but it has no companion object.
How do I define the companion object of the type? I need to use the type in the class abc.