From 97b9dcf5881fc2d986ec40ec5502fd90d8597329 Mon Sep 17 00:00:00 2001 From: mihaylov Date: Mon, 20 Feb 2006 11:13:52 +0000 Subject: Simplified serializable attribute check --- src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src') 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) && -- cgit v1.2.3