haxe/src/haxe/Rest.cs
// Generated by Haxe 4.3.7

#pragma warning disable 109, 114, 219, 429, 168, 162
namespace haxe._Rest {
	public sealed class Rest_Impl_ {
		
		
		
		public static int get_length<T>(T[] this1) {
			return ( this1 as global::System.Array ).Length;
		}
		
		
		public static T[] of<T>(global::Array<T> array) {
			T[] ret = new T[array.length];
			global::cs.Lib.p_nativeArray<T>(((global::Array<T>) (array) ), ((global::System.Array) (ret) ));
			return ((T[]) (ret) );
		}
		
		
		public static T[] _new<T>(T[] a) {
			return ((T[]) (a) );
		}
		
		
		public static T @get<T>(T[] this1, int index) {
			return global::haxe.lang.Runtime.genericCast<T>(this1[index]);
		}
		
		
		public static global::Array<T> toArray<T>(T[] this1) {
			T[] result = new T[( this1 as global::System.Array ).Length];
			global::System.Array.Copy(((global::System.Array) (this1) ), ((int) (0) ), ((global::System.Array) (result) ), ((int) (0) ), ((int) (( this1 as global::System.Array ).Length) ));
			return global::Array<object>.ofNative<T>(((T[]) (result) ));
		}
		
		
		public static global::haxe.iterators.RestIterator<T> iterator<T>(T[] this1) {
			return new global::haxe.iterators.RestIterator<T>(((object) (this1) ));
		}
		
		
		public static global::haxe.iterators.RestKeyValueIterator<T> keyValueIterator<T>(T[] this1) {
			return new global::haxe.iterators.RestKeyValueIterator<T>(((object) (this1) ));
		}
		
		
		public static T[] append<T>(T[] this1, T item) {
			unchecked {
				T[] result = new T[( ( this1 as global::System.Array ).Length + 1 )];
				global::System.Array.Copy(((global::System.Array) (this1) ), ((int) (0) ), ((global::System.Array) (result) ), ((int) (0) ), ((int) (( this1 as global::System.Array ).Length) ));
				result[( this1 as global::System.Array ).Length] = item;
				return ((T[]) (result) );
			}
		}
		
		
		public static T[] prepend<T>(T[] this1, T item) {
			unchecked {
				T[] result = new T[( ( this1 as global::System.Array ).Length + 1 )];
				global::System.Array.Copy(((global::System.Array) (this1) ), ((int) (0) ), ((global::System.Array) (result) ), ((int) (1) ), ((int) (( this1 as global::System.Array ).Length) ));
				result[0] = item;
				return ((T[]) (result) );
			}
		}
		
		
		public static string toString<T>(T[] this1) {
			return global::haxe._Rest.Rest_Impl_.toArray<T>(((T[]) (this1) )).toString();
		}
		
		
	}
}