aboutsummaryrefslogtreecommitdiff
path: root/tests/disabled
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-08-24 08:21:38 +0200
committerMartin Odersky <odersky@gmail.com>2016-08-26 11:13:16 +0200
commitfcea3d54dd016600f5a96cda5d03f2a5ee81e7f1 (patch)
tree271c60eb4ee439c89c3bc1eb86e86d270bd4203a /tests/disabled
parent6d4469a627244eb0620a51764a3494f8250a8e2b (diff)
downloaddotty-fcea3d54dd016600f5a96cda5d03f2a5ee81e7f1.tar.gz
dotty-fcea3d54dd016600f5a96cda5d03f2a5ee81e7f1.tar.bz2
dotty-fcea3d54dd016600f5a96cda5d03f2a5ee81e7f1.zip
Implement alternative desugaring of for-if to filter.
Fallback to .filter if a .withFilter is not available, but do this only for .withFilter calls generated from for expressions (this is different from what scalac does; the latter can also rewrite .withFilter calls given in source, which is not desirable.
Diffstat (limited to 'tests/disabled')
-rw-r--r--tests/disabled/not-representable/t7035.scala17
-rw-r--r--tests/disabled/not-representable/t7228.scala76
2 files changed, 93 insertions, 0 deletions
diff --git a/tests/disabled/not-representable/t7035.scala b/tests/disabled/not-representable/t7035.scala
new file mode 100644
index 000000000..b1ce66cc6
--- /dev/null
+++ b/tests/disabled/not-representable/t7035.scala
@@ -0,0 +1,17 @@
+// 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}
+ List(someY.x: Int, someY.y: String, someY.z1: Boolean, someY.z2: Any)
+ someY.y = ""
+}
+
+object Test {
+ val y = Y(0, "", true, new {})
+ val unapp: Option[(Int, String, Boolean, Any)] = // was (Int, Boolean, String, Any) !!
+ Y.unapply(y)
+
+ val Y(a, b, c, d) = y
+ List(a: Int, b: String, c: Boolean, d: Any)
+}
diff --git a/tests/disabled/not-representable/t7228.scala b/tests/disabled/not-representable/t7228.scala
new file mode 100644
index 000000000..525327857
--- /dev/null
+++ b/tests/disabled/not-representable/t7228.scala
@@ -0,0 +1,76 @@
+// no longer works because dotty does not have a concept of weak conformance
+object AdaptWithWeaklyConformantType {
+ implicit class D(d: Double) { def double = d*2 }
+
+ val x1: Int = 1
+ var x2: Int = 2
+ val x3 = 3
+ var x4 = 4
+ final val x5 = 5
+ final var x6 = 6
+
+ def f1 = x1.double
+ def f2 = x2.double
+ def f3 = x3.double
+ def f4 = x4.double
+ def f5 = x5.double
+ def f6 = x6.double
+}
+
+object AdaptAliasWithWeaklyConformantType {
+ implicit class D(d: Double) { def double = d*2 }
+ type T = Int
+
+ val x1: T = 1
+ var x2: T = 2
+ val x3 = (3: T)
+ var x4 = (4: T)
+ final val x5 = (5: T)
+ final var x6 = (6: T)
+
+ def f1 = x1.double
+ def f2 = x2.double
+ def f3 = x3.double
+ def f4 = x4.double
+ def f5 = x5.double
+ def f6 = x6.double
+}
+
+object AdaptToAliasWithWeaklyConformantType {
+ type U = Double
+ implicit class D(d: U) { def double = d*2 }
+
+ val x1: Int = 1
+ var x2: Int = 2
+ val x3 = (3: Int)
+ var x4 = (4: Int)
+ final val x5 = (5: Int)
+ final var x6 = (6: Int)
+
+ def f1 = x1.double
+ def f2 = x2.double
+ def f3 = x3.double
+ def f4 = x4.double
+ def f5 = x5.double
+ def f6 = x6.double
+}
+
+object AdaptAliasToAliasWithWeaklyConformantType {
+ type U = Double
+ type T = Int
+ implicit class D(d: U) { def double = d*2 }
+
+ val x1: T = 1
+ var x2: T = 2
+ val x3 = (3: T)
+ var x4 = (4: T)
+ final val x5 = (5: T)
+ final var x6 = (6: T)
+
+ def f1 = x1.double
+ def f2 = x2.double
+ def f3 = x3.double
+ def f4 = x4.double
+ def f5 = x5.double
+ def f6 = x6.double
+}