Merge pull request #1861 from saper/home-override
[mono-project.git] / mcs / tests / test-anon-54.cs
bloba0962cdaf895e038206ec8c388242e8b591eaf3c
1 using System;
3 public delegate void Hello ();
5 struct Foo
7 public int ID;
9 public Foo (int id)
11 this.ID = id;
14 public void Test (Foo foo)
16 Foo bar = this;
17 Hello hello = delegate {
18 foo.Hello (8);
19 bar.Hello (3);
21 hello ();
24 public void Hello (int value)
26 if (ID != value)
27 throw new InvalidOperationException ();
30 public override string ToString ()
32 return String.Format ("Foo ({0})", ID);
36 class X
38 public static void Main ()
40 Foo foo = new Foo (3);
41 foo.Test (new Foo (8));