summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authormihaylov <mihaylov@epfl.ch>2006-02-20 11:13:52 +0000
committermihaylov <mihaylov@epfl.ch>2006-02-20 11:13:52 +0000
commit97b9dcf5881fc2d986ec40ec5502fd90d8597329 (patch)
treef6fc09e9e4b37a8b0643cbf3b72d60df84d1c742 /src/compiler
parentf5d48370ee0953356f1f2f8e8cedecea070f5c24 (diff)
downloadscala-97b9dcf5881fc2d986ec40ec5502fd90d8597329.tar.gz
scala-97b9dcf5881fc2d986ec40ec5502fd90d8597329.tar.bz2
scala-97b9dcf5881fc2d986ec40ec5502fd90d8597329.zip
Simplified serializable attribute check
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala9
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) &&