From 7947a7b0fc818128f5e2a0cd10cc43d2d7614354 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sun, 25 Oct 2015 17:09:32 +0100 Subject: 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. --- tests/pos/range.scala | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 tests/pos/range.scala (limited to 'tests/pos') 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) +} -- cgit v1.2.3