2010-05-27 Jb Evain <jbevain@novell.com>
[mcs.git] / tests / test-216.cs
blob2edf452e9769a9462e544e1e89a7f1c0da5da0ce
1 //
2 // A compilation test: accessing an event from a nested class.
3 // Bug 48710
4 //
5 using System;
7 public delegate void OnWhateverDelegate( string s );
9 class cls
11 public event OnWhateverDelegate OnWhatever;
13 class nestedcls
15 internal void CallParentDel( cls c, string s )
17 c.OnWhatever( s );
20 internal void CallMyDel( string s)
22 (new nestedcls()).CallParentDel( this, s );
26 class MonoEmbed
28 static void Main()
30 cls c = new cls();
31 c.OnWhatever += new OnWhateverDelegate( Whatever );
32 c.CallMyDel( "test" );
34 static void Whatever( string s )
36 Console.WriteLine( s );