Move preserved types to link.xml.

This commit is contained in:
2023-12-02 00:29:23 +08:00
parent 6e01b255a6
commit 446724f9ca
4 changed files with 11 additions and 133 deletions

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: b35ffffce02252548a66e18cf98050e2
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -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<object> p = Enumerable.Empty<object>();
p.All(i => false);
p.Any();
p.Any(i => false);
p.Cast<object>();
p.Concat(Enumerable.Empty<object>());
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("", "");
}
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 29a6376ce10b77e4099d2613876f9549
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -2,4 +2,15 @@
<assembly fullname="Cryville.Common.Interop" ignoreIfMissing="1">
<namespace fullname="Cryville.Common.Interop.LPUTF8StrMarshaler" preserve="all" />
</assembly>
<assembly fullname="mscorlib">
<type fullname="System.Convert" preserve="all" />
<type fullname="System.MissingMemberException" preserve="all" />
<type fullname="System.Collections.Generic.Dictionary`2" preserve="all" />
<type fullname="System.Collections.Generic.List`1" preserve="all" />
<type fullname="System.IO.BinaryReader" preserve="all" />
<type fullname="System.IO.StreamReader" preserve="all" />
</assembly>
<assembly fullname="System.Core">
<type fullname="System.Linq.Enumerable" preserve="all" />
</assembly>
</linker>