title: Cryptic F# error - The signature and implementation are not compatible because the declaration of the type parameter requires a constraint of 'T=null
body: <p>I have a small piece of F# code that is generating a cryptic error I can't figure out....</p>
  
  <pre><code>namespace epic.View
  
  open System
  open FSharp.Desktop.UI
  
  [&lt;AbstractClass&gt;]
  type public FieldModelBase&lt;'ValueType&gt;() = 
      inherit Model() 
      let mutable fieldCaption: string = null
      let mutable fieldValue: 'ValueType = null
      [&lt;DerivedProperty&gt;]
      member this.Caption with public get() = sprintf "%s" fieldCaption and set value = fieldCaption &lt;- sprintf "%s" value; this.NotifyPropertyChanged "Caption"
      [&lt;DerivedProperty&gt;]
      member inline this.Value with public get() = fieldValue and set value = fieldValue &lt;- value; this.NotifyPropertyChanged "Value"
  </code></pre>
  
  <p>which generates the following error:</p>
  
  <blockquote>
    <p>The signature and implementation are not compatible because the
    declaration of the type parameter 'ValueType' requires a constraint of
    the form 'ValueType : null</p>
  </blockquote>
  
  <p>What does this mean and how do I resolve it? It looks like I should be adding a type constraint on the 'ValueType type-parameter to require it is... mutable? is that right?</p>