From 446724f9ca552b693266eda52e73cc976e1811ef Mon Sep 17 00:00:00 2001 From: PopSlime Date: Sat, 2 Dec 2023 00:29:23 +0800 Subject: [PATCH] Move preserved types to `link.xml`. --- Assets/Cryville/Crtr/Extension.meta | 8 -- Assets/Cryville/Crtr/Extension/RefTypes.cs | 114 ------------------ .../Cryville/Crtr/Extension/RefTypes.cs.meta | 11 -- Assets/link.xml | 11 ++ 4 files changed, 11 insertions(+), 133 deletions(-) delete mode 100644 Assets/Cryville/Crtr/Extension.meta delete mode 100644 Assets/Cryville/Crtr/Extension/RefTypes.cs delete mode 100644 Assets/Cryville/Crtr/Extension/RefTypes.cs.meta diff --git a/Assets/Cryville/Crtr/Extension.meta b/Assets/Cryville/Crtr/Extension.meta deleted file mode 100644 index bc942cb..0000000 --- a/Assets/Cryville/Crtr/Extension.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: b35ffffce02252548a66e18cf98050e2 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Cryville/Crtr/Extension/RefTypes.cs b/Assets/Cryville/Crtr/Extension/RefTypes.cs deleted file mode 100644 index 31d5f72..0000000 --- a/Assets/Cryville/Crtr/Extension/RefTypes.cs +++ /dev/null @@ -1,114 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using System.Linq; -using UnityEngine.Scripting; - -namespace Cryville.Crtr.Extension { - [Preserve] - public static class RefTypes { - [Preserve] - public static void PreserveEnumerable() { - IEnumerable p = Enumerable.Empty(); - p.All(i => false); - p.Any(); - p.Any(i => false); - p.Cast(); - p.Concat(Enumerable.Empty()); - p.Contains(null); - p.Count(); - p.Count(i => false); - p.DefaultIfEmpty(); - p.DefaultIfEmpty(null); - p.Distinct(); - p.ElementAt(0); - p.ElementAtOrDefault(0); - p.First(); - p.First(i => false); - p.FirstOrDefault(); - p.FirstOrDefault(i => false); - p.GetEnumerator(); - p.Last(); - p.Last(i => false); - p.LastOrDefault(); - p.LastOrDefault(i => false); - p.LongCount(); - p.LongCount(i => false); - p.OrderBy(i => i).ThenBy(i => i); - p.OrderByDescending(i => i).ThenByDescending(i => i); - p.Reverse(); - p.Select(i => i); - p.Select((i, j) => false); - p.SequenceEqual(p); - p.Single(); - p.Single(i => false); - p.SingleOrDefault(); - p.SingleOrDefault(i => false); - p.Skip(0); - p.SkipLast(0); - p.SkipWhile(i => false); - p.SkipWhile((i, j) => false); - p.Take(0); - p.TakeLast(0); - p.TakeWhile(i => false); - p.TakeWhile((i, j) => false); - p.ToArray(); - p.ToDictionary(i => new object()); - p.ToDictionary(i => new object(), i => new object()); - p.ToHashSet(); - p.ToList(); - p.Where(i => false); - p.Where((i, j) => false); - } - [Preserve] - public static void PreserveBinaryReader() { - BinaryReader p = new BinaryReader(null); - p.Close(); - p.Dispose(); - p.PeekChar(); - p.Read(); - p.ReadBoolean(); - p.ReadByte(); - p.ReadBytes(0); - p.ReadChar(); - p.ReadChars(0); - p.ReadDouble(); - p.ReadInt16(); - p.ReadInt32(); - p.ReadInt64(); - p.ReadSByte(); - p.ReadSingle(); - p.ReadUInt16(); - p.ReadUInt32(); - p.ReadUInt64(); - } - [Preserve] - public static void PreserveStreamReader() { - object _; - StreamReader p = new StreamReader((Stream)null); - p.Close(); - _ = p.CurrentEncoding; - p.DiscardBufferedData(); - p.Dispose(); - _ = p.EndOfStream; - p.Peek(); - p.Read(); - p.ReadBlock(null, 0, 0); - p.ReadLine(); - p.ReadToEnd(); - } - [Preserve] - public static void PreserveConvert() { - Convert.ChangeType(0, typeof(byte)); - Convert.ChangeType(0, typeof(byte), CultureInfo.InvariantCulture); - } - [Preserve] - public static void PreserveExceptions() { - new MissingMemberException(); - new MissingMemberException(""); - new MissingMemberException("", (Exception)null); - new MissingMemberException("", ""); - } - } -} diff --git a/Assets/Cryville/Crtr/Extension/RefTypes.cs.meta b/Assets/Cryville/Crtr/Extension/RefTypes.cs.meta deleted file mode 100644 index 36b2388..0000000 --- a/Assets/Cryville/Crtr/Extension/RefTypes.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 29a6376ce10b77e4099d2613876f9549 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/link.xml b/Assets/link.xml index f6758bd..e867a17 100644 --- a/Assets/link.xml +++ b/Assets/link.xml @@ -2,4 +2,15 @@ + + + + + + + + + + + \ No newline at end of file