All pastes #896795 Raw Edit

Anonymous

public text v1 · immutable
·published 2008-02-08 23:27 UTC
rendered paste body
struct Vector {
	double a;

	public Vector (double x)
	{
		a = x;
	}
}

class X {
	static void Main ()
	{
		Vector v = new Vector (1);

		M (ref v);
	}

	static void M (ref Vector a)
	{
	}
	
}


This is generated:

.assembly 've'
{
  .hash algorithm 0x00008004
  .ver  0:0:0:0
}
.module ve.exe // GUID = {EA564477-54F1-4B1E-B3AC-E948F783313C}


  .class private sequential ansi sealed beforefieldinit Vector
        extends [mscorlib]System.ValueType
  {
    .field  private  float64 a

    // method line 1
    .method public hidebysig  specialname  rtspecialname 
           instance default void '.ctor' (float64 x)  cil managed 
    {
        // Method begins at RVA 0x20ec
        // Code size 8 (0x8)
        .maxstack 8
        IL_0000:  ldarg.0 
        IL_0001:  ldarg.1 
        IL_0002:  stfld float64 Vector::a
        IL_0007:  ret 
    } // end of method Vector::.ctor

  } // end of class Vector

  .class private auto ansi beforefieldinit X
        extends [mscorlib]System.Object
  {

    // method line 2
    .method public hidebysig  specialname  rtspecialname 
           instance default void '.ctor' ()  cil managed 
    {
        // Method begins at RVA 0x20f8
        // Code size 7 (0x7)
        .maxstack 8
        IL_0000:  ldarg.0 
        IL_0001:  call instance void object::'.ctor'()
        IL_0006:  ret 
    } // end of method X::.ctor

    // method line 3
    .method private static  hidebysig 
           default void Main ()  cil managed 
    {
        // Method begins at RVA 0x2100
        .entrypoint
        // Code size 24 (0x18)
        .maxstack 4
        .locals init (
                valuetype Vector        V_0)
        IL_0000:  ldloca.s 0
        IL_0002:  ldc.r8 1.
        IL_000b:  call instance void valuetype Vector::'.ctor'(float64)
        IL_0010:  ldloca.s 0
        IL_0012:  call void class X::M([out] valuetype Vector&)
        IL_0017:  ret 
    } // end of method X::Main

    // method line 4
    .method private static  hidebysig 
           default void M (valuetype Vector& a)  cil managed 
    {
        // Method begins at RVA 0x2124
        // Code size 1 (0x1)
        .maxstack 8
        IL_0000:  ret 
    } // end of method X::M

  } // end of class X