Remove allocations from Dns.* (dotnet/corefx#41061)
[mono-project.git] / mono / tests / bug-685908.cs
blob32a9faa6e1fc588f925fb024ea5c89839b5da618
2 using System;
3 using System.Linq;
4 using System.Linq.Expressions;
6 class Program
8 static int Main ()
10 if (Test<S> () == 5)
11 return 0;
12 return 1;
15 static int Test<T> () where T : I
17 Expression<Func<T, int>> e = l => l.SetValue () + l.Value;
18 var arg = default (T);
19 return (int) (e.Compile () (arg));
23 interface I
25 int Value { get; }
26 int SetValue ();
29 struct S : I
31 int value;
33 public int Value {
34 get {
35 return value;
39 public int SetValue ()
41 value = 5;
42 return 0;