diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala b/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala index 192cc94b90a6..5afe38cba493 100644 --- a/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala +++ b/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala @@ -156,6 +156,7 @@ abstract class Pickler extends SubComponent { putChildren(sym, children.toList sortBy (_.sealedSortName)) } + if (sym.isTypeParameter && sym.hasAnnotation(definitions.SpecializedClass)) sym.setFlag(SPECIALIZED) for (annot <- (sym.annotations filter (ann => ann.isStatic && !ann.isErroneous)).reverse) putAnnotation(sym, annot) } diff --git a/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala b/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala index ffcb682cf765..bdaf85a353c8 100644 --- a/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala +++ b/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala @@ -631,7 +631,7 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers { overloads(specMember) ::= Overload(om, typeEnv(om)) enterMember(om) } - + for (m <- normMembers ; if needsSpecialization(outerEnv ++ env, m) && satisfiable(fullEnv)) { if (!m.isDeferred) addConcreteSpecMethod(m) @@ -1573,7 +1573,7 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers { } case fwd @ Forward(_) => - debuglog("forward: " + fwd + ", " + ddef) + debuglog("forward: " + fwd + ", " + ddef + ", " + tree.symbol.owner) val rhs1 = forwardCall(tree.pos, gen.mkAttributedRef(symbol.owner.thisType, fwd.target), vparamss) debuglog("-->d completed forwarder to specialized overload: " + fwd.target + ": " + rhs1) reportError { diff --git a/src/compiler/scala/tools/nsc/transform/UnCurry.scala b/src/compiler/scala/tools/nsc/transform/UnCurry.scala index 663b3dd2e918..863c3d7e957e 100644 --- a/src/compiler/scala/tools/nsc/transform/UnCurry.scala +++ b/src/compiler/scala/tools/nsc/transform/UnCurry.scala @@ -566,10 +566,10 @@ abstract class UnCurry extends InfoTransform val sym = tree.symbol // Take a pass looking for @specialize annotations and set all // their SPECIALIZE flags for cheaper recognition. - if ((sym ne null) && (sym.isClass || sym.isMethod)) { - for (tp <- sym.typeParams ; if tp hasAnnotation SpecializedClass) - tp setFlag SPECIALIZED - } + // if ((sym ne null) && (sym.isClass || sym.isMethod)) { + // for (tp <- sym.typeParams ; if tp hasAnnotation SpecializedClass) + // tp setFlag SPECIALIZED + // } val result = ( // TODO - settings.noassertions.value temporarily retained to avoid // breakage until a reasonable interface is settled upon. diff --git a/src/reflect/scala/reflect/internal/pickling/UnPickler.scala b/src/reflect/scala/reflect/internal/pickling/UnPickler.scala index 757163a07449..299398ef71bc 100644 --- a/src/reflect/scala/reflect/internal/pickling/UnPickler.scala +++ b/src/reflect/scala/reflect/internal/pickling/UnPickler.scala @@ -486,7 +486,9 @@ abstract class UnPickler /*extends reflect.generic.UnPickler*/ { errorBadSignature("symbol annotation expected ("+ tag +")") val end = readNat() + readIndex val target = readSymbolRef() - target.addAnnotation(readAnnotationInfo(end)) + val annot = readAnnotationInfo(end) + target.addAnnotation(annot) + if (target.hasAnnotation(definitions.SpecializedClass)) target.setFlag(SPECIALIZED) } /** Read an annotation and return it. Used when unpickling