-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Package-private nested case class in a library can be seen from other packages #18545
Labels
Comments
package iolib:
case class IO[A](value: A)
sealed trait IOLocal[A]
object IOLocal:
def apply[A](default: A): IO[IOLocal[A]] = IO(new IOLocalImpl(default))
private[IOLocal] final class IOLocalImpl[A](default: A) extends IOLocal[A]
package tests:
import iolib.IOLocal
def test = IOLocal.IOLocalImpl.apply(42) |
Scala 2 also changes its messaging if the line is corrected:
from
to
where Scala 3 misses the erroneous apply or constructor proxy. |
odersky
added a commit
to dotty-staging/dotty
that referenced
this issue
Nov 10, 2023
When creating a constructor proxy symbol we forgot to copy the privateWithin of the traget class. Fixes scala#18545
odersky
added a commit
that referenced
this issue
Nov 10, 2023
When creating a constructor proxy symbol we forgot to copy the privateWithin of the target class. Fixes #18545
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Compiler version
3.3.1, 3.4.0-RC1-bin-20230911-1be790c-NIGHTLY
Minimized code
Note:
IOLocalImpl
is defined asprivate[IOLocal] final class IOLocalImpl[A](default: A)
Output
Expectation
Compiler failure
Extra detail
I wasn't able to reproduce this without a library dependency.
The text was updated successfully, but these errors were encountered: