forked from scala/scala3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reinterpret Scala 2 case accessors
xyz$access$idx
(scala#18907)
Fixes scala#18884 Related to scala#18874
- Loading branch information
Showing
8 changed files
with
73 additions
and
14 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
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,2 @@ | ||
def test(xs: ::[Int]): List[Int] = | ||
xs.next$access$1 // error |
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,4 @@ | ||
Foo1(1) | ||
Foo2(2, 3) | ||
Foo3(4, 5) | ||
Foo4(6, 7) |
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,10 @@ | ||
// scalajs: --skip | ||
|
||
package lib | ||
|
||
case class Foo1(private[lib] var x: Int) {} | ||
case class Foo2(private[lib] var x: Int, private[lib] var y: Int) | ||
case class Foo3(private[lib] var x: Int, var y: Int) | ||
case class Foo4(var x: Int, private[lib] var y: Int) { | ||
val z: Int = x | ||
} |
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,14 @@ | ||
import lib.* | ||
|
||
@main def Test: Unit = | ||
test(new Foo1(1)) | ||
test(new Foo2(2, 3)) | ||
test(new Foo3(4, 5)) | ||
test(new Foo4(6, 7)) | ||
|
||
def test(any: Any): Unit = | ||
any match | ||
case Foo1(x) => println(s"Foo1($x)") | ||
case Foo2(x, y) => println(s"Foo2($x, $y)") | ||
case Foo3(x, y) => println(s"Foo3($x, $y)") | ||
case Foo4(x, y) => println(s"Foo4($x, $y)") |
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