summaryrefslogtreecommitdiff
path: root/src
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-07-30 09:58:23 +0200
commitdefb1465909c3f740871a56973c32b276f775b91 (patch)
treef31ae4c9fdb189302788fa31e61919d5b298128d /src
parent512d19387da86ce95d7edd1742bf03287cf68a39 (diff)
downloadscala-defb1465909c3f740871a56973c32b276f775b91.tar.gz
scala-defb1465909c3f740871a56973c32b276f775b91.tar.bz2
scala-defb1465909c3f740871a56973c32b276f775b91.zip
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 'src')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala b/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala
index c156b8c677..4ccc183334 100644
--- a/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala
@@ -304,6 +304,7 @@ trait SyntheticMethods extends ast.TreeDSL {
clazz.isModuleClass
&& clazz.isSerializable
&& !hasConcreteImpl(nme.readResolve)
+ && clazz.isStatic
)
def synthesize(): List[Tree] = {