Add support for generic methods, improved non-generic dictionary output

This commit is contained in:
sinaioutlander
2020-09-18 18:03:17 +10:00
parent db91968519
commit b154cbf39d
6 changed files with 149 additions and 25 deletions

View File

@ -5,6 +5,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MelonLoader;
using Mono.CSharp.Linq;
using UnityEngine;
namespace Explorer.Tests
@ -26,6 +27,18 @@ namespace Explorer.Tests
public static int StaticField = 5;
public int NonStaticField;
// test a generic method
public static string TestGeneric<C, T>(string arg0) where C : Component
{
return "C: " + typeof(C).FullName + ", T: " + typeof(T).FullName + ", arg0: " + arg0;
}
//// this type of generic is not supported, due to requiring a non-primitive argument.
//public static T TestDifferentGeneric<T>(T obj) where T : Component
//{
// return obj;
//}
// test a non-generic dictionary
public Hashtable TestNonGenericDict()