summaryrefslogtreecommitdiff
path: root/sources/scala/tools/nsc/typechecker/Namers.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2005-08-29 14:38:38 +0000
committerMartin Odersky <odersky@gmail.com>2005-08-29 14:38:38 +0000
commit184a284ccc9c842adaaec728914f11a2cad33c18 (patch)
tree25ae4ff123300b6dc24f4c1a2ec0182105e75ec6 /sources/scala/tools/nsc/typechecker/Namers.scala
parent7d50bd127a071b84cc3d5e6e989b5f57d5988aaf (diff)
downloadscala-184a284ccc9c842adaaec728914f11a2cad33c18.tar.gz
scala-184a284ccc9c842adaaec728914f11a2cad33c18.tar.bz2
scala-184a284ccc9c842adaaec728914f11a2cad33c18.zip
*** empty log message ***
Diffstat (limited to 'sources/scala/tools/nsc/typechecker/Namers.scala')
-rwxr-xr-xsources/scala/tools/nsc/typechecker/Namers.scala32
1 files changed, 16 insertions, 16 deletions
diff --git a/sources/scala/tools/nsc/typechecker/Namers.scala b/sources/scala/tools/nsc/typechecker/Namers.scala
index bb63df325d..601bb74ef5 100755
--- a/sources/scala/tools/nsc/typechecker/Namers.scala
+++ b/sources/scala/tools/nsc/typechecker/Namers.scala
@@ -14,6 +14,20 @@ trait Namers: Analyzer {
import global._;
import definitions._;
+ def updatePosFlags(sym: Symbol, pos: int, mods: int): Symbol = {
+ if (settings.debug.value) log("overwriting " + sym);
+ sym.pos = pos;
+ val oldflags = sym.flags & (INITIALIZED | LOCKED);
+ val newflags = mods & ~(INITIALIZED | LOCKED);
+ sym.flags = oldflags | newflags;
+ if (sym.isModule)
+ updatePosFlags(sym.moduleClass, pos, (mods & ModuleToClassFlags) | MODULE | FINAL);
+ if (sym.owner.isPackageClass && sym.linkedSym.rawInfo.isInstanceOf[loaders.SymbolLoader])
+ // pre-set linked symbol to NoType, in case it is not loaded together with this symbol.
+ sym.linkedSym.setInfo(NoType);
+ sym
+ }
+
class Namer(val context: Context) {
private def isTemplateContext(context: Context): boolean = context.tree match {
@@ -35,20 +49,6 @@ trait Namers: Analyzer {
sym.name.toString() + " is already defined as " +
(if (sym.hasFlag(CASE)) "case class " + sym.name else sym.toString()));
- private def updatePosFlags(sym: Symbol, pos: int, mods: int): Symbol = {
- if (settings.debug.value) log("overwriting " + sym);
- sym.pos = pos;
- val oldflags = sym.flags & (INITIALIZED | LOCKED);
- val newflags = mods & ~(INITIALIZED | LOCKED);
- sym.flags = oldflags | newflags;
- if (sym.isModule)
- updatePosFlags(sym.moduleClass, pos, (mods & ModuleToClassFlags) | MODULE | FINAL);
- if (sym.owner.isPackageClass && sym.linkedSym.rawInfo.isInstanceOf[loaders.SymbolLoader])
- // pre-set linked symbol to NoType, in case it is not loaded together with this symbol.
- sym.linkedSym.setInfo(NoType);
- sym
- }
-
def enterInScope(sym: Symbol): Symbol = {
if (!(sym.isSourceMethod && sym.owner.isClass)) {
val prev = context.scope.lookupEntry(sym.name);
@@ -284,7 +284,7 @@ trait Namers: Analyzer {
val restype =
if (tpt.isEmpty) {
tpt.tpe = if (meth.name == nme.CONSTRUCTOR) context.enclClass.owner.tpe
- else deconstIfNotFinal(meth, typer.typed(rhs).tpe);
+ else deconstIfNotFinal(meth, typer.computeType(rhs));
tpt.tpe
} else typer.typedType(tpt).tpe;
def mkMethodType(vparams: List[Symbol], restpe: Type) = {
@@ -359,7 +359,7 @@ trait Namers: Analyzer {
context.error(tpt.pos, "missing parameter type");
ErrorType
} else {
- tpt.tpe = deconstIfNotFinal(sym, newTyper(context.make(tree, sym)).typed(rhs).tpe);
+ tpt.tpe = deconstIfNotFinal(sym, newTyper(context.make(tree, sym)).computeType(rhs));
tpt.tpe
}
else typer.typedType(tpt).tpe