title: Trouble compiling some decompiled C# code
body: <p>I was decompiling an open-source project (because the source for the latest version hasn't been released yet).  Using RedGate's Reflector tool, it gave me this block of code:</p>
  
  <pre><code>if(somecondition == true)
  {
      ref Vector3i vectoriRef;
      float num17 = length - num;
      Vector3i end = vectori3;
      (vectoriRef = (Vector3i) &amp;end)[1] = vectoriRef[1] - ((int) num17);
  }
  </code></pre>
  
  <p><code>somecondition</code> is a boolean.  <code>length</code> and <code>num</code> are floats defined outside the code. <code>vectori3</code> is also defined outside the code and is of type Vector3i. The type <a href="http://www.codeproject.com/KB/recipes/VectorType.aspx" rel="nofollow">Vector3i is essentially this code</a>, but with x, y, and z stored as integers. </p>
  
  <p>When I try to compile this decompiled code, I get the following errors:</p>
  
  <ul>
  <li>Line 2: Only assignment, call, increment, decrement, and new object expressions can be used as a statement</li>
  <li>Line 3: ; expected</li>
  <li>Line 3: Invalid expression term 'ref'</li>
  <li>Line 6: 'Vector3i' is a 'type' but is used like a 'variable'</li>
  </ul>
  
  <p>Any thoughts on how I can fix this code so it compiles correctly and does whatever it was intended to do?</p>
  
  <p><strong>UPDATE:</strong> It turns out the source <strong>is</strong> available in their repository, but you have to follow a maze of links and clues to even find it.  Thanks to everyone who posted!</p>