1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
class Outer { private val x: Int = 1 class Inner { def foo: x.type = x // error: non-private method foo refers to private value x in its type signature } } class Outer3Neg { def meth: Unit = { class Inner { private val x: Int = 1 def foo: x.type = x // error } } }