I’m trying to do this in Scala, but for some reason it won’t work
abstract class Room {
...
}
class RoomA1 extends Room { //"not found: type Room"
//but they're in the same package!!!
//and if I import it as Eclipse suggests the import declaration will give
//"Room is not a member of rooms(rooms.type)"
...
}
and also…
var room = new Array[Room](2)
room(0) = new RoomA1 //gives a type mismatch
//how can I accomplish this?
There’s nothing wrong in your code. Here’s an output of REPL which proves that:
The problem must be in how you placed it in a package, which one, in which file under which directory. You should broaden your question with this info.