Closed
Description
Compiler version
3.3.1
Minimized code
class A:
private[this] def foo: Int = 1
def bar(other: A): Int = other.foo
Compiler output
Compiles fine.
Expectation
Compiler warning or error, either
- about
foo
not being visible onother
(as in Scala 2). - about
private[this]
being deprecated/dropped in Scala 3, and having the same meaning asprivate
.
In Scala 3.4.0 Nightly, the compiler warning still does not mention the unexpected semantics of [this]
in this context, which doesn't seem documented anywhere. Being deprecated is not the same as being ignored.