summaryrefslogtreecommitdiff
path: root/sources/scala/tools
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2005-09-23 14:48:49 +0000
committerMartin Odersky <odersky@gmail.com>2005-09-23 14:48:49 +0000
commitc7cf81fcb58232236948d50ee3a13c97bbfdc23c (patch)
treeb93e5279c03bf7405923918406433f34924a3f26 /sources/scala/tools
parentf730f48c1f898898a13150e4502aa8aadb9e421b (diff)
downloadscala-c7cf81fcb58232236948d50ee3a13c97bbfdc23c.tar.gz
scala-c7cf81fcb58232236948d50ee3a13c97bbfdc23c.tar.bz2
scala-c7cf81fcb58232236948d50ee3a13c97bbfdc23c.zip
*** empty log message ***
Diffstat (limited to 'sources/scala/tools')
-rwxr-xr-xsources/scala/tools/nsc/symtab/SymbolTable.scala4
-rwxr-xr-xsources/scala/tools/nsc/symtab/Symbols.scala2
-rwxr-xr-xsources/scala/tools/nsc/transform/Mixin.scala8
-rwxr-xr-xsources/scala/tools/nsc/typechecker/RefChecks.scala9
4 files changed, 18 insertions, 5 deletions
diff --git a/sources/scala/tools/nsc/symtab/SymbolTable.scala b/sources/scala/tools/nsc/symtab/SymbolTable.scala
index 32f128cdc9..c928e13096 100755
--- a/sources/scala/tools/nsc/symtab/SymbolTable.scala
+++ b/sources/scala/tools/nsc/symtab/SymbolTable.scala
@@ -30,6 +30,10 @@ abstract class SymbolTable extends Names
final val NoRun = 0;
+ /** The number of the current compiler run. Runs start at 2 and increment by 2's.
+ * Odd run numbers in the `validForRun' field of symbols indicate that the type of
+ * the symbol is not yet fully defined.
+ */
var currentRun: int = NoRun;
def atPhase[T](ph: Phase)(op: => T): T = {
diff --git a/sources/scala/tools/nsc/symtab/Symbols.scala b/sources/scala/tools/nsc/symtab/Symbols.scala
index 72b5a35f73..162bff1d57 100755
--- a/sources/scala/tools/nsc/symtab/Symbols.scala
+++ b/sources/scala/tools/nsc/symtab/Symbols.scala
@@ -195,7 +195,7 @@ abstract class Symbols: SymbolTable {
!owner.isPackageClass && owner.isLocalClass);
/** Symbol was preloaded from package */
- final def isExternal: boolean = pos == Position.NOPOS;
+ final def isExternal: boolean = pos == Position.NOPOS/* || validForRun < currentRun - 1*/;
/** A a member of class `base' is incomplete if (1) it is declared deferred or
* (2) it is abstract override and its super symbol in `base' is nonexistent or inclomplete.
diff --git a/sources/scala/tools/nsc/transform/Mixin.scala b/sources/scala/tools/nsc/transform/Mixin.scala
index 587057e47a..f12ca011f2 100755
--- a/sources/scala/tools/nsc/transform/Mixin.scala
+++ b/sources/scala/tools/nsc/transform/Mixin.scala
@@ -330,6 +330,14 @@ abstract class Mixin extends InfoTransform {
}
}
}
+/*
+ case Ident(_) =>
+ if (sym.owner.isClass) {
+ assert(sym.isModuleVar, sym);
+ assert(!sym.owner.isImplClass, sym);
+ atPos(tree.pos) {
+ gen.SelectThis(
+*/
case Assign(Apply(lhs @ Select(qual, _), List()), rhs) =>
localTyper.typed {
atPos(tree.pos) {
diff --git a/sources/scala/tools/nsc/typechecker/RefChecks.scala b/sources/scala/tools/nsc/typechecker/RefChecks.scala
index 9443b4f981..7f1652f581 100755
--- a/sources/scala/tools/nsc/typechecker/RefChecks.scala
+++ b/sources/scala/tools/nsc/typechecker/RefChecks.scala
@@ -64,18 +64,19 @@ abstract class RefChecks extends InfoTransform {
}
// def m: T = { if (m$ == null) m$ = new m$class; m$ }
- def newModuleAccessDef(accessor: Symbol, mvar: Symbol) =
+ def newModuleAccessDef(accessor: Symbol, mvar: Symbol) = {
DefDef(accessor, vparamss =>
Block(
List(
If(
- Apply(Select(gen.mkRef(mvar), nme.eq), List(Literal(Constant(null)))),
- Assign(gen.mkRef(mvar),
+ Apply(Select(Ident(mvar), nme.eq), List(Literal(Constant(null)))),
+ Assign(Ident(mvar),
New(TypeTree(mvar.tpe),
List(for (val pt <- mvar.tpe.symbol.primaryConstructor.info.paramTypes)
yield This(accessor.owner.enclClass)))),//???
EmptyTree)),
- gen.mkRef(mvar)));
+ Ident(mvar)))
+ }
class RefCheckTransformer(unit: CompilationUnit) extends Transformer {