aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/range.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-10-25 17:09:32 +0100
committerMartin Odersky <odersky@gmail.com>2015-10-25 17:09:32 +0100
commit7947a7b0fc818128f5e2a0cd10cc43d2d7614354 (patch)
tree90b86a23c2713754a21d7f030ecf3205a151e014 /tests/pos/range.scala
parent08df804a5b4b7289a1518aa5ccf9753ec1a8cd7a (diff)
downloaddotty-7947a7b0fc818128f5e2a0cd10cc43d2d7614354.tar.gz
dotty-7947a7b0fc818128f5e2a0cd10cc43d2d7614354.tar.bz2
dotty-7947a7b0fc818128f5e2a0cd10cc43d2d7614354.zip
Fix hole in subtyping of modules
We did not handle correctly the case exemplified by `range.scala`: A module this type, which is compared with a getter to the same module. Seen in the wild in scala.math.BigDecimal.
Diffstat (limited to 'tests/pos/range.scala')
-rw-r--r--tests/pos/range.scala9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/pos/range.scala b/tests/pos/range.scala
new file mode 100644
index 000000000..9e7b5d1c9
--- /dev/null
+++ b/tests/pos/range.scala
@@ -0,0 +1,9 @@
+import scala.math._
+import collection.immutable.NumericRange
+object Test {
+ val r1: scala.collection.immutable.Range.Partial = ???
+ val r2: scala.Range.Partial = r1
+ def until(d: BigDecimal, end: BigDecimal): Range.Partial[BigDecimal, NumericRange.Exclusive[BigDecimal]] =
+ new Range.Partial(until(d, end, _))
+ def until(d: BigDecimal, end: BigDecimal, step: BigDecimal) = Range.BigDecimal(d, end, step)
+}