aboutsummaryrefslogtreecommitdiff
path: root/tests/pickling
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-12-10 11:18:36 +0100
committerMartin Odersky <odersky@gmail.com>2015-12-14 14:30:09 +0100
commitdb9d4f0fcccde4caa2a586a9d874dc479b104318 (patch)
tree6457db46b8357c444fc9dc447be3c52bafc77315 /tests/pickling
parentf829cf8ba742b149a10250710c46b5a1c49aa7cc (diff)
downloaddotty-db9d4f0fcccde4caa2a586a9d874dc479b104318.tar.gz
dotty-db9d4f0fcccde4caa2a586a9d874dc479b104318.tar.bz2
dotty-db9d4f0fcccde4caa2a586a9d874dc479b104318.zip
Add test case
Diffstat (limited to 'tests/pickling')
-rw-r--r--tests/pickling/selfSym.scala26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/pickling/selfSym.scala b/tests/pickling/selfSym.scala
new file mode 100644
index 000000000..ab8db8513
--- /dev/null
+++ b/tests/pickling/selfSym.scala
@@ -0,0 +1,26 @@
+// A test which exercises both param forwarding and explicit self types,
+// so param forwarder definitions will get symbolic references.
+// It leads to tricky situations which manifest themselves by pickle
+// failures. Before pickling, a param accessor still had
+// the value type (which is wrong), when reading back the
+// pickled info, this type is then the correct ExprType.
+// Fixed by adapating references oto param forwarders in ParamForwarding.scala
+// Without the symblolic reference, this error was somehow masked by
+// the fact that the reference cache was already updated to the
+// good info.
+package test
+
+class Base(val x: Int)
+
+abstract class Middle(x: Int) extends Base(x) { self: Sub =>
+
+ def f(y: Int): Int = x + y
+
+}
+
+class Sub extends Middle(2) {
+
+ override def f(x: Int) = x
+
+}
+