diff options
author | paltherr <paltherr@epfl.ch> | 2003-09-08 00:50:35 +0000 |
---|---|---|
committer | paltherr <paltherr@epfl.ch> | 2003-09-08 00:50:35 +0000 |
commit | bb6372b1c9958dcd6c60d3e7802ea587f3f2f644 (patch) | |
tree | afe77e5a84721a99cb479726f08cee069419f4cf /sources/scalac/symtab | |
parent | a9af998cdc3175c764fa0f17d276dfd96dfe1579 (diff) | |
download | scala-bb6372b1c9958dcd6c60d3e7802ea587f3f2f644.tar.gz scala-bb6372b1c9958dcd6c60d3e7802ea587f3f2f644.tar.bz2 scala-bb6372b1c9958dcd6c60d3e7802ea587f3f2f644.zip |
- Added more general getSubst methods in Type
- Added do nothing methods in Type.UdpdateSubstSymMap
Diffstat (limited to 'sources/scalac/symtab')
-rw-r--r-- | sources/scalac/symtab/Type.java | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/sources/scalac/symtab/Type.java b/sources/scalac/symtab/Type.java index 427353bfdf..e3526f8830 100644 --- a/sources/scalac/symtab/Type.java +++ b/sources/scalac/symtab/Type.java @@ -1239,12 +1239,27 @@ public class Type implements Modifiers, Kinds, TypeTags, EntryTags { return super.apply(t); } } + public Symbol map(Symbol sym, boolean dontClone) { return sym; } + public Symbol[] map(Symbol[] syms, boolean dontClone) { return syms; } + public Scope map(Scope s) { return s; } + } + + /** Returns the given non-updating symbol/symbol substitution. */ + public static Map getSubst(Symbol[] from, Symbol[] to) { + return getSubst(from, to, false); + } + + /** Returns the given (updating?) symbol/symbol substitution. */ + public static Map getSubst(Symbol[] from, Symbol[] to, boolean update) { + if (from.length == 0 && to.length == 0) return IdMap; + if (update) return new UpdateSubstSymMap(from, to); + return new SubstSymMap(from, to); } - /** Returns an updating substitution map for given arguments. */ - public static Map getUpdateSubst(Symbol[] from, Symbol[] to) { + /** Returns the given non-updating symbol/type substitution. */ + public static Map getSubst(Symbol[] from, Type[] to) { if (from.length == 0 && to.length == 0) return IdMap; - return new UpdateSubstSymMap(from, to); + return new SubstTypeMap(from, to); } /** Substitute symbols `to' for occurrences of symbols `from' in this type. |