1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-15 06:44:10 +02:00

Improvements to interfaces: extensions, better generics, statics

This commit is contained in:
Brian Fiete 2020-05-27 09:46:09 -07:00
parent bff1d657cc
commit 6cb2df65a6
12 changed files with 322 additions and 68 deletions

View file

@ -270,5 +270,17 @@ namespace Tests
TestDefaults();
}
public static TTo Convert<TFrom, TTo>(TFrom val) where TTo : operator explicit TFrom
{
return (TTo)val;
}
[Test]
public static void TestConversion()
{
int a = 123;
float f = Convert<int, float>(a);
}
}
}