Merge pull request #5675 from mono/glib-debug-symbols
[mono.git] / mcs / tests / test-216.cs
1 //
2 // A compilation test: accessing an event from a nested class.
3 // Bug 48710
4 //
5 using System;
6
7 public delegate void OnWhateverDelegate( string s );
8
9 class cls
10 {
11         public event OnWhateverDelegate OnWhatever;
12
13         class nestedcls
14         {
15                 internal void CallParentDel( cls c, string s )
16                 {
17                         c.OnWhatever( s );
18                 }
19         }
20         internal void CallMyDel( string s)
21         {
22                 (new nestedcls()).CallParentDel( this, s );
23         }
24 }
25
26 class MonoEmbed 
27 {
28         public static void Main() 
29         {
30                 cls c = new cls();
31                 c.OnWhatever += new OnWhateverDelegate( Whatever );
32                 c.CallMyDel( "test" );
33         }
34         static void Whatever( string s )
35         {
36                 Console.WriteLine( s );
37         }
38 }
39
40
41