-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also add privateWithin when creating constructor proxies (#18893)
When creating a constructor proxy symbol we forgot to copy the privateWithin of the target class. Fixes #18545
- Loading branch information
Showing
3 changed files
with
36 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
-- [E173] Reference Error: tests/neg/i18545.scala:13:20 ---------------------------------------------------------------- | ||
13 | def test: IOLocal.IOLocalImpl[Int] = // error | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
|class IOLocalImpl cannot be accessed as a member of iolib.IOLocal.type from the top-level definitions in package tests. | ||
| private[IOLocal] class IOLocalImpl can only be accessed from object IOLocal in package iolib. | ||
-- [E173] Reference Error: tests/neg/i18545.scala:14:24 ---------------------------------------------------------------- | ||
14 | IOLocal.IOLocalImpl.apply(42) // error | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|method apply cannot be accessed as a member of iolib.IOLocal.IOLocalImpl.type from the top-level definitions in package tests. | ||
| private[IOLocal] method apply can only be accessed from object IOLocal in package iolib. | ||
-- [E050] Type Error: tests/neg/i18545.scala:15:22 --------------------------------------------------------------------- | ||
15 | def test2 = IOLocal.IOLocalImpl(42) // error | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
| object IOLocalImpl in object IOLocal does not take parameters | ||
| | ||
| longer explanation available when compiling with `-explain` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
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[Int] = // error | ||
IOLocal.IOLocalImpl.apply(42) // error | ||
def test2 = IOLocal.IOLocalImpl(42) // error |