summaryrefslogtreecommitdiff
path: root/sources/scalac
diff options
context:
space:
mode:
authorschinz <schinz@epfl.ch>2003-06-27 09:05:16 +0000
committerschinz <schinz@epfl.ch>2003-06-27 09:05:16 +0000
commitb95c08c879d5822355de9026ed87a85b8008307f (patch)
tree958b2eb907ddab391ef285cd25816b5457f7f62d /sources/scalac
parentf1a6676465fb972b1d1eca10e95c7fc46acc32db (diff)
downloadscala-b95c08c879d5822355de9026ed87a85b8008307f.tar.gz
scala-b95c08c879d5822355de9026ed87a85b8008307f.tar.bz2
scala-b95c08c879d5822355de9026ed87a85b8008307f.zip
- replaced uses of ThisTypeMap (now dead) by Ty...
- replaced uses of ThisTypeMap (now dead) by Type.SubstThisMap
Diffstat (limited to 'sources/scalac')
-rw-r--r--sources/scalac/transformer/AddInterfaces.java4
-rw-r--r--sources/scalac/transformer/AddInterfacesPhase.java27
2 files changed, 4 insertions, 27 deletions
diff --git a/sources/scalac/transformer/AddInterfaces.java b/sources/scalac/transformer/AddInterfaces.java
index b67774428a..2bbf5378c3 100644
--- a/sources/scalac/transformer/AddInterfaces.java
+++ b/sources/scalac/transformer/AddInterfaces.java
@@ -54,7 +54,7 @@ class AddInterfaces extends Transformer {
protected Pair/*<Symbol,Symbol>*/ ownerSubst = null;
protected StackedHashMap identSubst = new StackedHashMap();
protected SymbolSubstTypeMap typeSubst = new SymbolSubstTypeMap();
- protected ThisTypeMap thisTypeSubst = null;
+ protected Type.SubstThisMap thisTypeSubst = null;
protected LinkedList/*<List<Tree>>*/ bodyStack = new LinkedList();
@@ -279,7 +279,7 @@ class AddInterfaces extends Transformer {
Map classMemberMap = phase.getClassMemberMap(classSym);
assert thisTypeSubst == null;
- thisTypeSubst = new ThisTypeMap(ifaceSym, new Type.ThisType(classSym));
+ thisTypeSubst = new Type.SubstThisMap(ifaceSym, classSym);
for (int i = 0; i < classBody.length; ++i) {
Tree t = classBody[i];
diff --git a/sources/scalac/transformer/AddInterfacesPhase.java b/sources/scalac/transformer/AddInterfacesPhase.java
index 38f25a4d85..d2037118bc 100644
--- a/sources/scalac/transformer/AddInterfacesPhase.java
+++ b/sources/scalac/transformer/AddInterfacesPhase.java
@@ -214,7 +214,7 @@ public class AddInterfacesPhase extends PhaseDescriptor {
} else
symMap = map;
- ThisTypeMap thisTypeMap = new ThisTypeMap(oldOwner, newOwner);
+ Type.SubstThisMap thisTypeMap = new Type.SubstThisMap(oldOwner, newOwner);
Type newTp = thisTypeMap.apply(substParams(clone.info(), symMap));
clone.updateInfo(newTp);
return clone;
@@ -263,8 +263,7 @@ public class AddInterfacesPhase extends PhaseDescriptor {
// modified anymore.
classSubst = Collections.unmodifiableMap(classSubst);
- ThisTypeMap thisTpMap =
- new ThisTypeMap(ifaceSym, new Type.ThisType(classSym));
+ Type.SubstThisMap thisTpMap = new Type.SubstThisMap(ifaceSym, classSym);
Symbol[] vparams = classConstrSym.valueParams();
for (int i = 0; i < vparams.length; ++i) {
@@ -448,25 +447,3 @@ public class AddInterfacesPhase extends PhaseDescriptor {
}
}
}
-
-class ThisTypeMap extends Type.Map {
- private Symbol sym;
- private Type tp;
-
- public ThisTypeMap(Symbol sym, Type tp) {
- this.sym = sym; this.tp = tp;
- }
-
- public ThisTypeMap(Symbol oldSym, Symbol newSym) {
- this(oldSym, new Type.ThisType(newSym));
- }
-
- public Type apply(Type t) {
- switch (t) {
- case ThisType(Symbol s):
- return (s == sym) ? tp : t;
- default:
- return map(t);
- }
- }
-}