diff options
author | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-06-15 17:50:04 +0200 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-06-15 17:50:04 +0200 |
commit | 506a5e334d57084322fa89119d72fa96beb824b6 (patch) | |
tree | 83401f75400ac373e5ae68d633bbf9de2b6ce8d9 /tests/run/t7859/B_2.scala | |
parent | c4c29e393afb7175422053924b7e1e5a30131c4c (diff) | |
download | dotty-506a5e334d57084322fa89119d72fa96beb824b6.tar.gz dotty-506a5e334d57084322fa89119d72fa96beb824b6.tar.bz2 dotty-506a5e334d57084322fa89119d72fa96beb824b6.zip |
Enable tests that succeed.
Diffstat (limited to 'tests/run/t7859/B_2.scala')
-rw-r--r-- | tests/run/t7859/B_2.scala | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/tests/run/t7859/B_2.scala b/tests/run/t7859/B_2.scala new file mode 100644 index 000000000..052322ef6 --- /dev/null +++ b/tests/run/t7859/B_2.scala @@ -0,0 +1,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]): Unit = { + unboxA + unboxA1 + unboxA2 + unboxB + } + + def unboxA: Unit = { + val o: Some[A] = Some(A.Const) + val a = o.get + def id(a: A): A = a + id(a) + } + + def unboxA1: Unit = { + val o: Some[A1] = Some(new A1(0)) + val a = o.get + def id(a: A1): A1 = a + id(a) + } + + def unboxA2: Unit = { + 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: Unit = { + val o: Some[B] = Some(B.Const) + val b = o.get + def id(b: B): B = b + id(b) + } +} |