summaryrefslogtreecommitdiff
path: root/sources/scalac/symtab
diff options
context:
space:
mode:
authorpaltherr <paltherr@epfl.ch>2003-07-14 09:15:20 +0000
committerpaltherr <paltherr@epfl.ch>2003-07-14 09:15:20 +0000
commitbecb3c22d6f70c943925842a041a90f01bc5ad58 (patch)
treee20840038f496a2ac355448a3b82a3256394bd7a /sources/scalac/symtab
parentc66ad962e6c4a9e71017506d731b7003e9b0b4f3 (diff)
downloadscala-becb3c22d6f70c943925842a041a90f01bc5ad58.tar.gz
scala-becb3c22d6f70c943925842a041a90f01bc5ad58.tar.bz2
scala-becb3c22d6f70c943925842a041a90f01bc5ad58.zip
- Removed the "as seen from" part from method c...
- Removed the "as seen from" part from method cloneType (was never used)
Diffstat (limited to 'sources/scalac/symtab')
-rw-r--r--sources/scalac/symtab/Type.java16
1 files changed, 4 insertions, 12 deletions
diff --git a/sources/scalac/symtab/Type.java b/sources/scalac/symtab/Type.java
index 0b1e1b6405..45e32dfda3 100644
--- a/sources/scalac/symtab/Type.java
+++ b/sources/scalac/symtab/Type.java
@@ -1257,18 +1257,10 @@ public class Type implements Modifiers, Kinds, TypeTags {
// Cloning ---------------------------------------------------------------
/**
- * Clones a type i.e. returns a new type "as seen from" the new
- * owner and where all symbols in MethodTypes and PolyTypes have
- * been cloned.
+ * Clones a type i.e. returns a new type where all symbols in
+ * MethodTypes and PolyTypes have been cloned.
*/
public Type cloneType(Symbol oldOwner, Symbol newOwner) {
- Type clone = cloneType0(oldOwner, newOwner);
- if (oldOwner != newOwner && oldOwner.isClass())
- clone = new SubstThisMap(oldOwner, newOwner).applyParams(clone);
- return clone;
- }
-
- private Type cloneType0(Symbol oldOwner, Symbol newOwner) {
switch (this) {
case MethodType(Symbol[] vparams, Type result):
@@ -1277,7 +1269,7 @@ public class Type implements Modifiers, Kinds, TypeTags {
assert vparams[i].owner() == oldOwner : Debug.show(vparams[i]);
clones[i] = vparams[i].cloneSymbol(newOwner);
}
- result = result.cloneType0(oldOwner, newOwner);
+ result = result.cloneType(oldOwner, newOwner);
Type clone = Type.MethodType(clones, result);
if (vparams.length != 0)
clone = new SubstSymMap(vparams, clones).applyParams(clone);
@@ -1289,7 +1281,7 @@ public class Type implements Modifiers, Kinds, TypeTags {
assert tparams[i].owner() == oldOwner : Debug.show(tparams[i]);
clones[i] = tparams[i].cloneSymbol(newOwner);
}
- result = result.cloneType0(oldOwner, newOwner);
+ result = result.cloneType(oldOwner, newOwner);
Type clone = Type.PolyType(clones, result);
if (tparams.length != 0)
clone = new SubstSymMap(tparams, clones).applyParams(clone);