OK, the first step of Rikxtensible C# has been done. Ever wanted to print "Hello World" via an attribute? This fragment now compiles, and after running through Rikxtensible C# allows the PrivateImportAttribute to provide the code for TestMethod.
class TestClass
{
[PrivateImport(), MethodImpl(MethodImplOptions.ForwardRef)]
static extern void TestMethod();
[STAThread]
static void Main(string[] args)
{
TestMethod();
}
}
Obviously, this is only a proof of concept at the moment but soon we'll have compile time code injection for C#.