From ae23ef23441ab396847db50bbffb75237bda2c47 Mon Sep 17 00:00:00 2001 From: mihaylov Date: Wed, 18 Jan 2006 12:12:48 +0000 Subject: Made anonymous functions serializable --- src/compiler/scala/tools/nsc/symtab/Symbols.scala | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/compiler') diff --git a/src/compiler/scala/tools/nsc/symtab/Symbols.scala b/src/compiler/scala/tools/nsc/symtab/Symbols.scala index 702231dccc..d93298d5c6 100644 --- a/src/compiler/scala/tools/nsc/symtab/Symbols.scala +++ b/src/compiler/scala/tools/nsc/symtab/Symbols.scala @@ -117,8 +117,12 @@ mixin class Symbols requires SymbolTable { new ModuleClassSymbol(this, pos, name); final def newAnonymousClass(pos: int) = newClass(pos, nme.ANON_CLASS_NAME.toTypeName); - final def newAnonymousFunctionClass(pos: int) = - newClass(pos, nme.ANON_FUN_NAME.toTypeName); + final def newAnonymousFunctionClass(pos: int) = { + val anonfun = newClass(pos, nme.ANON_FUN_NAME.toTypeName); + anonfun.attributes = + Pair(definitions.SerializableAttr, List()) :: anonfun.attributes; + anonfun + } final def newRefinementClass(pos: int) = newClass(pos, nme.REFINE_CLASS_NAME.toTypeName); final def newErrorClass(name: Name) = { -- cgit v1.2.3