diff options
author | paltherr <paltherr@epfl.ch> | 2003-09-07 19:03:19 +0000 |
---|---|---|
committer | paltherr <paltherr@epfl.ch> | 2003-09-07 19:03:19 +0000 |
commit | a9af998cdc3175c764fa0f17d276dfd96dfe1579 (patch) | |
tree | c73529a3df070b105d4a77c282c10fd62005e0ff /sources/scalac/symtab | |
parent | 70d78cbfc802ccc49d5d324755865ff07985dfef (diff) | |
download | scala-a9af998cdc3175c764fa0f17d276dfd96dfe1579.tar.gz scala-a9af998cdc3175c764fa0f17d276dfd96dfe1579.tar.bz2 scala-a9af998cdc3175c764fa0f17d276dfd96dfe1579.zip |
- Added concat methods
Diffstat (limited to 'sources/scalac/symtab')
-rw-r--r-- | sources/scalac/symtab/Symbol.java | 9 | ||||
-rw-r--r-- | sources/scalac/symtab/Type.java | 9 |
2 files changed, 18 insertions, 0 deletions
diff --git a/sources/scalac/symtab/Symbol.java b/sources/scalac/symtab/Symbol.java index 8a583ccff9..f332e16610 100644 --- a/sources/scalac/symtab/Symbol.java +++ b/sources/scalac/symtab/Symbol.java @@ -118,6 +118,15 @@ public abstract class Symbol implements Modifiers, Kinds { return clone; } + /** Returns the concatenation of the two arrays. */ + public static Symbol[] concat(Symbol[] array1, Symbol[] array2) { + if (array1.length == 0) return array2; + if (array2.length == 0) return array1; + Symbol[] clone = cloneArray(array1.length, array2); + for (int i = 0; i < array1.length; i++) clone[i] = array1[i]; + return clone; + } + /** copy all fields to `sym' */ public void copyTo(Symbol sym) { diff --git a/sources/scalac/symtab/Type.java b/sources/scalac/symtab/Type.java index e94c7e87bc..427353bfdf 100644 --- a/sources/scalac/symtab/Type.java +++ b/sources/scalac/symtab/Type.java @@ -1393,6 +1393,15 @@ public class Type implements Modifiers, Kinds, TypeTags, EntryTags { return clone; } + /** Returns the concatenation of the two arrays. */ + public static Type[] concat(Type[] array1, Type[] array2) { + if (array1.length == 0) return array2; + if (array2.length == 0) return array1; + Type[] clone = cloneArray(array1.length, array2); + for (int i = 0; i < array1.length; i++) clone[i] = array1[i]; + return clone; + } + /** * Clones a type i.e. returns a new type where all symbols in * MethodTypes and PolyTypes have been cloned. |