Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

43 lines
580 B
C#

using System;
using System.Reflection;
public struct Container<T>
{
public T content;
public Container (T content)
{
this.content = content;
}
}
public class A
{
public Container<long> field;
public A ()
{
field = new Container<long> (0xdeadbeaf);
}
}
public class M
{
public static int Main()
{
A a = new A();
if (a.field.content != 0xdeadbeaf)
return 1;
FieldInfo fi = a.GetType().GetField("field");
object o = fi.GetValue (a);
Container<long> unboxed = (Container<long>) o;
if (unboxed.content != 0xdeadbeaf)
return 2;
return 0;
}
}