@@ -2776,7 +2776,11 @@ public string Empty
2776
2776
{
2777
2777
get
2778
2778
{
2779
+ #if UNITY_AOT
2780
+ return SR . EmptyEnumerable ;
2781
+ #else
2779
2782
return Strings . EmptyEnumerable ;
2783
+ #endif
2780
2784
}
2781
2785
}
2782
2786
}
@@ -2829,4 +2833,49 @@ public object[] Items
2829
2833
[ System . Diagnostics . DebuggerBrowsable ( System . Diagnostics . DebuggerBrowsableState . Never ) ]
2830
2834
private int count ;
2831
2835
}
2836
+
2837
+ #if UNITY_AOT
2838
+ // <summary>
2839
+ /// An iterator that can produce an array or <see cref="List{TElement}"/> through an optimized path.
2840
+ /// </summary>
2841
+ internal interface IIListProvider < TElement > : IEnumerable < TElement >
2842
+ {
2843
+ /// <summary>
2844
+ /// Produce an array of the sequence through an optimized path.
2845
+ /// </summary>
2846
+ /// <returns>The array.</returns>
2847
+ TElement [ ] ToArray ( ) ;
2848
+
2849
+ /// <summary>
2850
+ /// Produce a <see cref="List{TElement}"/> of the sequence through an optimized path.
2851
+ /// </summary>
2852
+ /// <returns>The <see cref="List{TElement}"/>.</returns>
2853
+ List < TElement > ToList ( ) ;
2854
+
2855
+ /// <summary>
2856
+ /// Returns the count of elements in the sequence.
2857
+ /// </summary>
2858
+ /// <param name="onlyIfCheap">If true then the count should only be calculated if doing
2859
+ /// so is quick (sure or likely to be constant time), otherwise -1 should be returned.</param>
2860
+ /// <returns>The number of elements.</returns>
2861
+ int GetCount ( bool onlyIfCheap ) ;
2862
+ }
2863
+
2864
+ internal static partial class Error
2865
+ {
2866
+ internal static Exception ArgumentNull ( string s ) => new ArgumentNullException ( s ) ;
2867
+
2868
+ internal static Exception ArgumentOutOfRange ( string s ) => new ArgumentOutOfRangeException ( s ) ;
2869
+
2870
+ internal static Exception MoreThanOneElement ( ) => new InvalidOperationException ( SR . MoreThanOneElement ) ;
2871
+
2872
+ internal static Exception MoreThanOneMatch ( ) => new InvalidOperationException ( SR . MoreThanOneMatch ) ;
2873
+
2874
+ internal static Exception NoElements ( ) => new InvalidOperationException ( SR . NoElements ) ;
2875
+
2876
+ internal static Exception NoMatch ( ) => new InvalidOperationException ( SR . NoMatch ) ;
2877
+
2878
+ internal static Exception NotSupported ( ) => new NotSupportedException ( ) ;
2879
+ }
2880
+ #endif
2832
2881
}
0 commit comments