class Test sig SimpleMethod def foo(s as SimpleMethod) raise s # .error. to invoke the method reference def foo2(s as SimpleMethod) f = 10 raise f # .error. target of "raise" is not an event def foo3(s as SimpleMethod) s() def y print 'invoked .y' def main is shared # error: Invalid expression for raising events. Use "raise .someEvent, args" or "throw SomeException(args)". raise Exception('message') # .error. throw x = Test() x.foo(ref x.y)