1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-19 08:30:25 +02:00

Added 'interface' and 'enum' constraints

This commit is contained in:
Brian Fiete 2020-11-10 05:44:23 -08:00
parent f63b9236d0
commit f41365a58e
8 changed files with 110 additions and 27 deletions

View file

@ -18,7 +18,7 @@ namespace System
((int32)iVal).ToString(strBuffer);
}
public static Result<T> Parse<T>(StringView str, bool ignoreCase = false) where T : Enum
public static Result<T> Parse<T>(StringView str, bool ignoreCase = false) where T : enum
{
var typeInst = (TypeInstance)typeof(T);
for (var field in typeInst.GetFields())