blob: 6b23af3abb7040cf024d5e6c40d261dc33665b4f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
class B private (private val b: Int) extends AnyVal
object B {
val Const = new B(0)
}
// These tests will require erasure to unbox the value class.
// We need to test under joint and separate compilation to check
// that the 'notPRIVATE' flag on the param accessor is pickled.
//
// See also SI-6601.
object Test {
def main(args: Array[String]) {
unboxA
unboxA1
unboxA2
unboxB
}
def unboxA {
val o: Some[A] = Some(A.Const)
val a = o.get
def id(a: A): A = a
id(a)
}
def unboxA1 {
val o: Some[A1] = Some(new A1(0))
val a = o.get
def id(a: A1): A1 = a
id(a)
}
def unboxA2 {
import p.A2
val o: Some[A2] = Some(new A2(0))
val a = o.get
def id(a: A2): A2 = a
id(a)
}
def unboxB {
val o: Some[B] = Some(B.Const)
val b = o.get
def id(b: B): B = b
id(b)
}
}
|