diff options
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. |