title: Why does this Delegate constraint not work with defining an event?
body: <p>I have this class where I am trying to create a template for one of my classes, and for that I needed to be able to pass a delegate type to define an event. I added the Delegate constraint to make sure it is a Delegate.</p>
  
  <pre><code>public abstract class TemplateScriptEvent&lt;DelegateType&gt; : ScriptEvent where DelegateType : Delegate
  {
      public event DelegateType Event;
  }
  </code></pre>
  
  <p>However, this causes</p>
  
  <p><code>Error    CS0066  '_ScriptEvent&lt;DelegateType&gt;.Event': event must be of a delegate type</code></p>
  
  <p>Is what I am trying to do even possible, and why is this failing?</p>
  
  <p>I am using the .Net Framework 4.7.2.</p>