Remove useless ip += from MINT_JMP, it is assigned later. (#19217)
[mono-project.git] / mcs / errors / cs1673-2.cs
blob4543d9bb0b0dc96aef01927fd8e5cdcf67b0e31c
1 // CS1673: Anonymous methods inside structs cannot access instance members of `this'. Consider copying `this' to a local variable outside the anonymous method and using the local instead
2 // Line: 19
3 using System;
5 public delegate void Hello ();
7 struct Foo
9 public int ID;
11 public Foo (int id)
13 this.ID = id;
16 public void Test (Foo foo)
18 Hello hello = delegate {
19 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 static void Main ()
40 Foo foo = new Foo (3);
41 foo.Test (new Foo (8));