-
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.
Generalize Scala 2
xyz$accessor$idx
fix
- Loading branch information
1 parent
bfe4f05
commit c71e8a1
Showing
4 changed files
with
38 additions
and
7 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,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,8 @@ | ||
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)") |