Skip to content

Commit 749d9b4

Browse files
committed
Fix #3518: Do not generate calls to BoxesRunTime for Unit box/unbox
1 parent c48f7b0 commit 749d9b4

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[submodule "scala-backend"]
22
path = scala-backend
3-
url = https://github.com/lampepfl/scala.git
3+
url = https://github.com/dotty-staging/scala.git
44
branch = sharing-backend
55
[submodule "scala2-library"]
66
path = scala2-library

tests/run/i3518.check

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
()
2+
()
3+
A
4+
()

tests/run/i3518.scala

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
object Test {
2+
def main(args: Array[String]): Unit = {
3+
Unit.box(())
4+
Unit.unbox(Unit.box(()))
5+
println(Unit.box(()))
6+
println(Unit.unbox(Unit.box(())))
7+
println(Unit.box({
8+
println("A")
9+
()
10+
}))
11+
}
12+
}

0 commit comments

Comments
 (0)