title: readonly-fields as targets from subclass constructors
body: <p>A readonly field should be used when you have a variable that will be known at object-instatiation which should not be changed afterwards.</p>
  
  <p>However one is not allowed to assign readonly fields from constructors of subclasses.
  This doesn't even work if the superclass is abstract.</p>
  
  <p>Does anyone have a good explanation why this either isn't a good idea, or lacks in the C# languange?</p>
  
  <pre><code>abstract class Super
  {
      protected readonly int Field;
  }
  
  class Sub : Super 
  {
      public Sub()
      {
          this.Field = 5; //Not compileable
      }
  }
  </code></pre>
  
  <p>PS: You can of course reach the same result by having assignment of the readonly fields in a protected constructor in the superclass.</p>