diff options
author | mihaylov <mihaylov@epfl.ch> | 2006-02-20 11:13:52 +0000 |
---|---|---|
committer | mihaylov <mihaylov@epfl.ch> | 2006-02-20 11:13:52 +0000 |
commit | 97b9dcf5881fc2d986ec40ec5502fd90d8597329 (patch) | |
tree | f6fc09e9e4b37a8b0643cbf3b72d60df84d1c742 /src | |
parent | f5d48370ee0953356f1f2f8e8cedecea070f5c24 (diff) | |
download | scala-97b9dcf5881fc2d986ec40ec5502fd90d8597329.tar.gz scala-97b9dcf5881fc2d986ec40ec5502fd90d8597329.tar.bz2 scala-97b9dcf5881fc2d986ec40ec5502fd90d8597329.zip |
Simplified serializable attribute check
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala b/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala index c53d1b3e99..67251d7bd6 100644 --- a/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala +++ b/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala @@ -86,13 +86,8 @@ mixin class SyntheticMethods requires Analyzer { Apply(gen.mkRef(target), This(clazz) :: (vparamss.head map Ident)))); } - val SerializableAttr = definitions.SerializableAttr.tpe; - def isSerializable(clazz: Symbol): Boolean = - clazz.attributes.exists(p => p match { - case Pair(SerializableAttr, _) => true; - case _ => false - }) + !clazz.getAttributes(definitions.SerializableAttr).isEmpty def readResolveMethod: Tree = { // !!! the synthetic method "readResolve" should be private, @@ -156,7 +151,7 @@ mixin class SyntheticMethods requires Analyzer { if ((clazz hasFlag CASE) && !phase.erasedTypes) { // case classes are implicitly declared serializable - clazz.attributes = Pair(SerializableAttr, List()) :: clazz.attributes; + clazz.attributes = Pair(SerializableAttr.tpe, List()) :: clazz.attributes; for (val stat <- templ.body) { if (stat.isDef && stat.symbol.isMethod && stat.symbol.hasFlag(CASEACCESSOR) && |