diff options
author | Paul Phillips <paulp@improving.org> | 2012-04-05 15:50:10 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-04-05 22:51:29 -0700 |
commit | 296b7061ccef8600c011140fa6fd64afec244ed0 (patch) | |
tree | 852bfad96dc8b980b18a7869640f4c400566baa5 /src/compiler/scala/tools/nsc/transform/AddInterfaces.scala | |
parent | 2b89c3459d1d9a9aa9dd5aba75847274d6f74129 (diff) | |
download | scala-296b7061ccef8600c011140fa6fd64afec244ed0.tar.gz scala-296b7061ccef8600c011140fa6fd64afec244ed0.tar.bz2 scala-296b7061ccef8600c011140fa6fd64afec244ed0.zip |
A boatload of work on Symbols and Flags.
Finally my dream of orderliness is within sight.
It's all pretty self-explanatory. More polymorphism, more immutable
identity, more invariants.
Diffstat (limited to 'src/compiler/scala/tools/nsc/transform/AddInterfaces.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/AddInterfaces.scala | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/AddInterfaces.scala b/src/compiler/scala/tools/nsc/transform/AddInterfaces.scala index 39e2cbe694..dde166d64b 100644 --- a/src/compiler/scala/tools/nsc/transform/AddInterfaces.scala +++ b/src/compiler/scala/tools/nsc/transform/AddInterfaces.scala @@ -43,11 +43,7 @@ abstract class AddInterfaces extends InfoTransform { self: Erasure => */ private def isInterfaceMember(sym: Symbol) = ( sym.isType || { - // !!! Shouldn't the following code be equivalent to leaving - // out the "sym.info" call and starting with "sym.initialize.isMethod" ? - // Because, it is not, which I found a little disturbing. The compiler - // fails to bootstrap with an error somewhere. - sym.info // initialize to set lateMETHOD flag if necessary + sym.info // initialize to set lateMETHOD flag if necessary ( sym.isMethod && !sym.isLabel @@ -71,6 +67,7 @@ abstract class AddInterfaces extends InfoTransform { self: Erasure => /** Return the implementation class of a trait; create a new one of one does not yet exist */ def implClass(iface: Symbol): Symbol = { iface.info + def implClassFlags = iface.flags & ~(INTERFACE | lateINTERFACE) | IMPLCLASS implClassMap.getOrElse(iface, { atPhase(implClassPhase) { @@ -101,7 +98,7 @@ abstract class AddInterfaces extends InfoTransform { self: Erasure => else log("not unlinking existing " + impl + " as the impl class is not visible on the classpath.") } if (impl == NoSymbol) { - impl = iface.cloneSymbolImpl(iface.owner) + impl = iface.cloneSymbolImpl(iface.owner, implClassFlags) impl.name = implName impl.sourceFile = iface.sourceFile if (iface.owner.isClass) @@ -109,7 +106,7 @@ abstract class AddInterfaces extends InfoTransform { self: Erasure => } if (currentRun.compiles(iface)) currentRun.symSource(impl) = iface.sourceFile impl setPos iface.pos - impl.flags = iface.flags & ~(INTERFACE | lateINTERFACE) | IMPLCLASS + impl.flags = implClassFlags impl setInfo new LazyImplClassType(iface) implClassMap(iface) = impl debuglog( |