summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2005-09-23 13:59:53 +0000
committerMartin Odersky <odersky@gmail.com>2005-09-23 13:59:53 +0000
commitf730f48c1f898898a13150e4502aa8aadb9e421b (patch)
treebc101fd5dc769037072aa83c646b7f3d5a9f2b87
parent1b62046e2e39a0ff092ed7679925e2f00401d6e1 (diff)
downloadscala-f730f48c1f898898a13150e4502aa8aadb9e421b.tar.gz
scala-f730f48c1f898898a13150e4502aa8aadb9e421b.tar.bz2
scala-f730f48c1f898898a13150e4502aa8aadb9e421b.zip
*** empty log message ***
-rwxr-xr-xsources/scala/tools/nsc/symtab/Types.scala12
-rwxr-xr-xsources/scala/tools/nsc/typechecker/RefChecks.scala6
2 files changed, 13 insertions, 5 deletions
diff --git a/sources/scala/tools/nsc/symtab/Types.scala b/sources/scala/tools/nsc/symtab/Types.scala
index 23a68176ef..2e770d0565 100755
--- a/sources/scala/tools/nsc/symtab/Types.scala
+++ b/sources/scala/tools/nsc/symtab/Types.scala
@@ -294,7 +294,7 @@ abstract class Types: SymbolTable {
def isComplete: boolean = true;
/** If this is a lazy type, assign a new type to `sym'. */
- def complete(sym: Symbol): unit = {}
+ def complete(sym: Symbol): unit = {}//sym.setInfo(rebindMap.apply(this));
/** If this is a symbol loader type, load and assign a new type to `sym'. */
def load(sym: Symbol): unit = {}
@@ -831,7 +831,7 @@ abstract class Types: SymbolTable {
/** Rebind symbol `sym' to an overriding member in type `pre' */
private def rebind(pre: Type, sym: Symbol): Symbol = {
val owner = sym.owner;
- if (owner.isClass && owner != pre.symbol && !sym.isFinal) {
+ if (owner.isClass && (owner != pre.symbol && !sym.isFinal || sym.validForRun != currentRun)) {
val rebind = pre.nonPrivateMember(sym.name).suchThat(sym => sym.isType || sym.isStable);
if (rebind == NoSymbol) sym else rebind
} else sym
@@ -1246,6 +1246,14 @@ abstract class Types: SymbolTable {
result = result.owner;
}
}
+/*
+ object rebindMap extends TypeMap {
+ def apply(tp: Type): Type = tp match {
+ case SingleType(pre, sym) =>
+ val pre1 = apply(pre);
+ if (sym.validForRun != currentRun)
+
+*/
// Helper Methods -------------------------------------------------------------
diff --git a/sources/scala/tools/nsc/typechecker/RefChecks.scala b/sources/scala/tools/nsc/typechecker/RefChecks.scala
index a32c7bf0e5..9443b4f981 100755
--- a/sources/scala/tools/nsc/typechecker/RefChecks.scala
+++ b/sources/scala/tools/nsc/typechecker/RefChecks.scala
@@ -69,13 +69,13 @@ abstract class RefChecks extends InfoTransform {
Block(
List(
If(
- Apply(Select(Ident(mvar), nme.eq), List(Literal(Constant(null)))),
- Assign(Ident(mvar),
+ Apply(Select(gen.mkRef(mvar), nme.eq), List(Literal(Constant(null)))),
+ Assign(gen.mkRef(mvar),
New(TypeTree(mvar.tpe),
List(for (val pt <- mvar.tpe.symbol.primaryConstructor.info.paramTypes)
yield This(accessor.owner.enclClass)))),//???
EmptyTree)),
- Ident(mvar)));
+ gen.mkRef(mvar)));
class RefCheckTransformer(unit: CompilationUnit) extends Transformer {