2 using System
.Runtime
.InteropServices
;
6 Console
.WriteLine("Hello, world!");
10 [StructLayout(LayoutKind
.Explicit
)]
12 [FieldOffset(0)] public short a
;
13 [FieldOffset(2)] public Z z
; // Unaligned reference
23 static void test2(X x
) {
24 Console
.WriteLine("Object: " + x
);
27 static void Inner () {
31 System
.GC
.WaitForPendingFinalizers();
38 } catch (TypeLoadException e
) {
39 Console
.WriteLine ("got correct exception: {0}", e
);