summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorShane Delmore <shane@delmore.io>2016-02-01 09:50:35 -0800
committerShane Delmore <shane@delmore.io>2016-02-01 09:51:27 -0800
commit7137a3bfa6863860b7aee7920f74fb8257e66c01 (patch)
tree0b2bc257e9442951d85d3ec1649bb33077b224c7 /test
parent36bf0c9d58bd1a7aa378ae4a5283b0d3271b725b (diff)
downloadscala-7137a3bfa6863860b7aee7920f74fb8257e66c01.tar.gz
scala-7137a3bfa6863860b7aee7920f74fb8257e66c01.tar.bz2
scala-7137a3bfa6863860b7aee7920f74fb8257e66c01.zip
Extend BigInt with Ordered for java interop
Diffstat (limited to 'test')
-rw-r--r--test/files/run/numbereq.scala3
-rw-r--r--test/junit/scala/math/BigIntTest.scala16
2 files changed, 18 insertions, 1 deletions
diff --git a/test/files/run/numbereq.scala b/test/files/run/numbereq.scala
index 7ce4b23cf8..1f12d0643e 100644
--- a/test/files/run/numbereq.scala
+++ b/test/files/run/numbereq.scala
@@ -1,6 +1,7 @@
object Test {
def mkNumbers(x: Int): List[AnyRef] = {
- val base = List(
+ //Use explicit AnyRef to workaround known limitation of type inference with F-Bounds
+ val base = List[AnyRef](
BigDecimal(x),
BigInt(x),
new java.lang.Double(x.toDouble),
diff --git a/test/junit/scala/math/BigIntTest.scala b/test/junit/scala/math/BigIntTest.scala
new file mode 100644
index 0000000000..5a5694a775
--- /dev/null
+++ b/test/junit/scala/math/BigIntTest.scala
@@ -0,0 +1,16 @@
+package scala.math
+
+import java.math.{BigInteger => BI, MathContext => MC}
+
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.JUnit4
+
+@RunWith(classOf[JUnit4])
+class BigIntTest {
+
+ @Test
+ def testIsComparable() {
+ assert(BigInt(1).isInstanceOf[java.lang.Comparable[_]])
+ }
+}