1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-29 04:55:58 +02:00

Changed ResolveSelfType to not require a type instance

This commit is contained in:
Brian Fiete 2022-04-30 08:10:57 -07:00
parent 1bacf5eee2
commit 717d6aa4cf
6 changed files with 71 additions and 61 deletions

View file

@ -389,6 +389,22 @@ namespace Tests
}
}
class Test5
{
public Result<T> TryGetValue<T>() where T : IParseable
{
T val = default;
var s = T.Serialize(val);
return T.Deserialize(s);
}
}
interface IParseable
{
public static Result<Self> Deserialize(StringView value);
public static String Serialize(Self value);
}
[Test]
public static void TestDefaults()
{