title: Dynamic Structs are failing
body: <p>I have a problem using a class of made of structures.  </p>
  
  <p>Here's the basic definition:</p>
  
  <pre><code>using System;
  
  struct Real
  {
      public double real;
  
      public Real(double real)
      { 
          this.real = real;
      }
  }
  
  class Record
  {
      public Real r;
      public Record(double r)
      {
          this.r = new Real(r);
      }
      public void Test(double origval, double newval)
      {
          if (this.r.real == newval)
              Console.WriteLine("r = newval-test passed\n");
          else if (this.r.real == origval)
              Console.WriteLine("r = origval-test failed\n");
          else
              Console.WriteLine("r = neither-test failed\n");
      }
  }
  </code></pre>
  
  <p>When I create a non-dynamic (static?) Record, setting the Real works.<br>
  When I create a dynamic Record, setting the real doesn't work.<br>
  When I create a dynamic Record, replacing the real works.  </p>
  
  <p>And here's the test program</p>
  
  <pre><code>class Program
  {
      static void Main(string[] args)
      {
          double origval = 8.0;
          double newval = 5.0;
  
          // THIS WORKS - create fixed type Record, print, change value, print
          Record record1 = new Record(origval);
          record1.r.real = newval;        // change value  ***
          record1.Test(origval, newval);
  
          // THIS DOESN'T WORK.  change value is not making any change!
          dynamic dynrecord2 = new Record(origval);
          dynrecord2.r.real = newval;     // change value
          dynrecord2.Test(origval, newval);
  
          // THIS WORKS - create dynamic type Record, print, change value, print
          dynamic dynrecord3 = new Record(origval);
          dynamic r = dynrecord3.r;       // copy out value
          r.real = newval;                // change copy
          dynrecord3.r = r;               // copy in modified value
          dynrecord3.Test(origval, newval);
  
      }
  }
  </code></pre>
  
  <p>And here's the output:
  r = newval-test passed
  r = origval-test failed
  r = newval-test passed</p>
  
  <p>When I change the struct Real to class Real, all three cases work.</p>
  
  <p>So what's going on?<br>
  Thanks,<br>
  Max</p>