diff options
author | michelou <michelou@epfl.ch> | 2009-09-08 16:24:42 +0000 |
---|---|---|
committer | michelou <michelou@epfl.ch> | 2009-09-08 16:24:42 +0000 |
commit | b06d4eb4ec8921a1d4935bf83ee8ba9c0ad08d18 (patch) | |
tree | 57c46bf4138486eb3c944fe4bc212d8e635dfa50 /src/compiler | |
parent | 2619f09ad0a5fc8900fcacc4d704a55b255f52e7 (diff) | |
download | scala-b06d4eb4ec8921a1d4935bf83ee8ba9c0ad08d18.tar.gz scala-b06d4eb4ec8921a1d4935bf83ee8ba9c0ad08d18.tar.bz2 scala-b06d4eb4ec8921a1d4935bf83ee8ba9c0ad08d18.zip |
added a few @serializable annotations, added @S...
added a few @serializable annotations, added @SerialVersionUID to
anonfuns, several cleanups
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/CleanUp.scala | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/CleanUp.scala b/src/compiler/scala/tools/nsc/transform/CleanUp.scala index 348f3cc5a3..6067249eae 100644 --- a/src/compiler/scala/tools/nsc/transform/CleanUp.scala +++ b/src/compiler/scala/tools/nsc/transform/CleanUp.scala @@ -47,6 +47,13 @@ abstract class CleanUp extends Transform with ast.TreeDSL { private var localTyper: analyzer.Typer = null + private lazy val serializableAnnotation = + AnnotationInfo(SerializableAttr.tpe, Nil, Nil) + private lazy val serialVersionUIDAnnotation = { + val attr = definitions.getClass("scala.SerialVersionUID") + AnnotationInfo(attr.tpe, List(Literal(Constant(0))), List()) + } + private object MethodDispatchType extends scala.Enumeration { val NO_CACHE, MONO_CACHE, POLY_CACHE = Value } @@ -598,8 +605,10 @@ abstract class CleanUp extends Transform with ast.TreeDSL { if (settings.target.value == "jvm-1.5") { val sym = cdef.symbol // is this an anonymous function class? - if (sym.isAnonymousFunction && !sym.hasAnnotation(SerializableAttr)) - sym addAnnotation AnnotationInfo(SerializableAttr.tpe, Nil, Nil) + if (sym.isAnonymousFunction && !sym.hasAnnotation(SerializableAttr)) { + sym addAnnotation serializableAnnotation + sym addAnnotation serialVersionUIDAnnotation + } } super.transform(tree) |