diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/disabled/not-representable/t7035.scala (renamed from tests/pending/pos/t7035.scala) | 2 | ||||
-rw-r--r-- | tests/disabled/not-representable/t7228.scala (renamed from tests/pending/pos/t7228.scala) | 1 | ||||
-rw-r--r-- | tests/pos/for-filter.scala | 12 |
3 files changed, 15 insertions, 0 deletions
diff --git a/tests/pending/pos/t7035.scala b/tests/disabled/not-representable/t7035.scala index f45bd0a87..b1ce66cc6 100644 --- a/tests/pending/pos/t7035.scala +++ b/tests/disabled/not-representable/t7035.scala @@ -1,3 +1,5 @@ +// no longer works because dotty uses name-nased pattern matching for case classes + case class Y(final var x: Int, final private var y: String, final val z1: Boolean, final private val z2: Any) { import Test.{y => someY} diff --git a/tests/pending/pos/t7228.scala b/tests/disabled/not-representable/t7228.scala index 5d936f652..525327857 100644 --- a/tests/pending/pos/t7228.scala +++ b/tests/disabled/not-representable/t7228.scala @@ -1,3 +1,4 @@ +// no longer works because dotty does not have a concept of weak conformance object AdaptWithWeaklyConformantType { implicit class D(d: Double) { def double = d*2 } diff --git a/tests/pos/for-filter.scala b/tests/pos/for-filter.scala new file mode 100644 index 000000000..3baac4f0c --- /dev/null +++ b/tests/pos/for-filter.scala @@ -0,0 +1,12 @@ +object Test { + + case class C[T](xs: List[T]) { + def filter(p: T => Boolean) = new C(xs.filter(p)) + def map[U](f: T => U) = new C(xs.map(f)) + } + + def main(args: Array[String]): Unit = + println(for (x <- C(List(1, 2, 3)) if x % 2 == 0) yield x) + // println(C(List(1, 2, 3)).withFilter(_ % 2 == 0)) // error + +} |