This page is no longer maintained — Please continue to the home page at

parent package scope

No replies
Joined: 2011-10-25,
User offline. Last seen 51 weeks 1 day ago.

[Relative newbie to scala]

I have a Database trait and its impl defined as follows:

package com.example.db

trait Database


package com.example.db.impl

class DatabaseImpl extends Database


I want to restrict access to the impl class to the parent db package.
Is it possible to restrict it so? If yes, does specifying a
private[db] modifier on the impl class suffice?


Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland