diff options
author | Miguel de Icaza <miguel@gnome.org> | 2002-03-11 20:28:36 +0300 |
---|---|---|
committer | Miguel de Icaza <miguel@gnome.org> | 2002-03-11 20:28:36 +0300 |
commit | c2f21c1549116c688dfea7e0841cf87d96cdda9b (patch) | |
tree | bceebecf37128386fae2f02b7d3f88db4b080615 /mcs/tests/test-83.cs | |
parent | c8a44c49d0827df39cb55bdee2ff0b4d465b800b (diff) |
Add new test
svn path=/trunk/mcs/; revision=3056
Diffstat (limited to 'mcs/tests/test-83.cs')
-rwxr-xr-x | mcs/tests/test-83.cs | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/mcs/tests/test-83.cs b/mcs/tests/test-83.cs new file mode 100755 index 00000000000..cf9629ada38 --- /dev/null +++ b/mcs/tests/test-83.cs @@ -0,0 +1,44 @@ +// +// This test probes that we treat events differently than fields +// This used to cause a compiler crash. +// +using System; + +delegate void PersonArrivedHandler (object source, PersonArrivedArgs args); + +class PersonArrivedArgs /*: EventArgs*/ { + public string name; + public PersonArrivedArgs (string name) { + this.name = name; + } +} + +class Greeter { + string greeting; + + public Greeter (string greeting) { + this.greeting = greeting; + } + + public void HandlePersonArrived (object source, PersonArrivedArgs args) { + Console.WriteLine(greeting, args.name); + } +} + +class Room { + public event PersonArrivedHandler PersonArrived; + + public Room () {} + + public void AddPerson (string name) { + PersonArrived(this, null); //(this, PersonArrivedArgs(name)); + } +} + +class DelegateTest { + static int Main () { + return 0; + } +} + + |