BOO-973: Compile error when attaching to an event on a locally defined generic or...
[boo.git] / tests / testcases / regression / BOO-973-1.boo
blob74d0e9cb40e60e352db3467057c9e77fc8d5a6c6
1 """
2 OnExternalEvent
3 OnInternalEvent
4 """
6 import System
8 callable MyEvent(sender as object, e as EventArgs)
10 class GenericFoo[of T]:
11 event AnExternalEvent as EventHandler
12 event AnInternalEvent as MyEvent
14 def TestEvents():
15 AnExternalEvent(self, EventArgs.Empty)
16 AnInternalEvent(self, EventArgs.Empty)
18 def OnExternalEvent(sender as object, e as EventArgs):
19 print "OnExternalEvent"
21 def OnInternalEvent(sender as object, e as EventArgs):
22 print "OnInternalEvent"
24 foo = GenericFoo[of string]()
25 foo.AnExternalEvent += OnExternalEvent
26 foo.AnInternalEvent += OnInternalEvent
27 foo.TestEvents()