private static void Main() { EmptyInterface x = 7; // x has dynamic type int and value 7 var i = x.TypeAssert <@int>(); // i has type int and value 7 fmt.Println(i); T y; y.name = "Me"; f(y); EmptyInterface s = S { "you" }; Switch(s) .Case(typeof(I))(() => { fmt.Println("S is an I!!"); }) .Case(typeof(NilType), typeof(@int))(() => { fmt.Println("S is nil or an int"); }) .Default(() => { fmt.Println("S is not an I"); }) ; }
private static void Main() { @bool b = false; @string s = "hello"; @int i = 12; EmptyInterface eb = b; EmptyInterface ai = (@int)12; //@string y1 = 0x266c; //char x = '\x266c'; //Console.WriteLine(x); Main1(); Main2(); Main3(); Main4(); Main5(); Main6(); Main7(); ref int value = ref Main8();