Skip to content

Commit 4aa4db4

Browse files
committed
Add a test to ensure that erased classes are actually erased at compile time
1 parent b01ec48 commit 4aa4db4

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
27
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
object Test {
2+
erased class Erased() {
3+
println("Oh no!!!")
4+
}
5+
6+
def f(x: Erased, y: Int = 0): Int = y + 5
7+
8+
def g() = Erased()
9+
10+
def main(args: Array[String]) =
11+
val y = Erased()
12+
val z = 10
13+
println(f(Erased()) + z + f(g(), 7))
14+
}

0 commit comments

Comments
 (0)