From 2b0f0a57c7b6a88084bf09b3115601e3fbee92b3 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Thu, 10 Feb 2011 17:47:52 +0000 Subject: Made cooking dependent on a flag rather than a ... Made cooking dependent on a flag rather than a variable. This way we do not waste space in Symbols AND we remain sane under cloning. Review by moors. (there's some debug output that I added to track down a seemingly not idempotent cooking Donna has when using Eclipse). --- src/compiler/scala/tools/nsc/symtab/Symbols.scala | 6 ++++-- src/library/scala/reflect/generic/Flags.scala | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/compiler/scala/tools/nsc/symtab/Symbols.scala b/src/compiler/scala/tools/nsc/symtab/Symbols.scala index 7aa15d2e42..5c43f892a5 100644 --- a/src/compiler/scala/tools/nsc/symtab/Symbols.scala +++ b/src/compiler/scala/tools/nsc/symtab/Symbols.scala @@ -850,11 +850,13 @@ trait Symbols extends reflect.generic.Symbols { self: SymbolTable => * This is done in checkAccessible and overriding checks in refchecks * We can't do this on class loading because it would result in infinite cycles. */ - private var triedCooking: Boolean = false final def cookJavaRawInfo() { // println("cookJavaRawInfo: "+(rawname, triedCooking)) - if(triedCooking) return else triedCooking = true // only try once... + if (hasFlag(TRIEDCOOKING)) return else setFlag(TRIEDCOOKING) // only try once... + val oldInfo = info doCookJavaRawInfo() + if ((info ne oldInfo) && settings.verbose.value) + println("cooking "+this+": "+oldInfo+" --> "+info) // DEBUG } protected def doCookJavaRawInfo(): Unit diff --git a/src/library/scala/reflect/generic/Flags.scala b/src/library/scala/reflect/generic/Flags.scala index 17530ff28c..d7c8ff9296 100755 --- a/src/library/scala/reflect/generic/Flags.scala +++ b/src/library/scala/reflect/generic/Flags.scala @@ -77,6 +77,8 @@ class Flags extends ModifierFlags { final val VBRIDGE = 0x40000000000L// symbol is a varargs bridge final val VARARGS = 0x80000000000L// symbol is a Java-style varargs method + final val TRIEDCOOKING = 0x100000000000L // ``Cooking'' has been tried on this symbol + // A Java method's type is ``cooked'' by transforming raw types to existentials // pickling and unpickling of flags -- cgit v1.2.3