Closed
Description
Compiler version
3.3.0-RC3
Minimized code
object o:
trait T private[o]()
def test = new o.T { }
Output
The code compiles. I would expect it not to. My expectation was that trait T private[o]()
scopes the constructor of T
private in o
(but maybe this is not the case?). I assume that the anonymous class created in new o.T { }
calls the T
's constructor. If that is the case, then I think creating instances of T
should only be possible within o
(which was the intention here).