2010-05-25 Jb Evain <jbevain@novell.com>
[mcs.git] / tests / test-763.cs
blobae8927ebda46ced04bfe9e3d199ace917827b05d
1 using System;
3 public class StaticDelegateWithSameNameAsInstance
5 private Provider _provider;
6 delegate void Provider (string s);
8 Provider MyProvider
10 set
12 _provider = value;
13 if (_provider != null) {
14 _provider ("v");
19 static int i = 1;
21 public void StaticCallback ()
23 i += 7;
24 MyProvider = StaticCallback;
27 public static void StaticCallback (string s)
29 if (s != "v")
30 throw new ApplicationException ();
32 i *= 3;
35 static int Main ()
37 new StaticDelegateWithSameNameAsInstance ().StaticCallback ();
39 Console.WriteLine (i);
40 if (i != 24)
41 return 1;
43 return 0;