summaryrefslogtreecommitdiff
path: root/test/files/pos
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@gmail.com>2015-07-29 11:39:04 +0200
committerLukas Rytz <lukas.rytz@gmail.com>2015-09-22 07:15:57 +0200
commit9a47e8124aaa2a94737ea3f01ef2fa1e95f91c49 (patch)
tree428c4c8435d6dfe99b4aeef971cf83e490dc5588 /test/files/pos
parent0f72dd37f85bbcaa07cfb325685dc019e6bc1c26 (diff)
downloadscala-9a47e8124aaa2a94737ea3f01ef2fa1e95f91c49.tar.gz
scala-9a47e8124aaa2a94737ea3f01ef2fa1e95f91c49.tar.bz2
scala-9a47e8124aaa2a94737ea3f01ef2fa1e95f91c49.zip
[backport] SI-9375 add synthetic readResolve only for static modules
For inner modules, the synthetic readResolve method would cause the module constructor to be invoked on de-serialization in certain situations. See the discussion in the ticket. Adds a comprehensive test around serializing and de-serializing modules.
Diffstat (limited to 'test/files/pos')
-rw-r--r--test/files/pos/t6666d.scala18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/files/pos/t6666d.scala b/test/files/pos/t6666d.scala
new file mode 100644
index 0000000000..49a688f91b
--- /dev/null
+++ b/test/files/pos/t6666d.scala
@@ -0,0 +1,18 @@
+
+import scala.collection.immutable.TreeMap
+import scala.math.Ordering
+
+class Test[K](param:TreeMap[K,Int]){
+ def this() = this({
+ implicit object TreeOrd extends Ordering[K](){
+ def compare(a: K, b: K) = {
+ -1
+ }
+ }
+ new TreeMap[K, Int]()
+ })
+}
+
+object Test extends App {
+ new Test()
+}