/// <summary> /// Ensure generic list type can be (de)deserializable on AOT environment. /// </summary> /// <typeparam name="T">The type of elements in the list</typeparam> public static void EnsureList <T>() { Ensure(() => { var a = new List <T>(); var b = new HashSet <T>(); var c = new CollectionWrapper <T>((IList)a); var d = new CollectionWrapper <T>((ICollection <T>)a); }); }