# http://cobra-language.com/trac/cobra/ticket/177 class Test def main has STAThread # This main method is not shared/static; Cobra does not require that. # But CLR does, so the Cobra compiler will generate a wrapper to invoke it. # This test verifies that the attributes are included on the generated wrapper method. count = 0 a = System.Reflection.Assembly.getEntryAssembly for t in a.getTypes if t.name == 'Test', continue m = t.getMethod('Main') attrs = m.getCustomAttributes(STAThreadAttribute, true) assert attrs.length == 1 count = 1 assert count == 1