title: TypeLite issue with generics and Enums?
body: <p>So I've got lots of .Net libraries/classes that I'd like to generate typescript definitions for. Typescript is great! I tried it with simple examples and it does work perfectly. The only issue I'm facing is that a combination that I have does not work with it. Here's how it doesnt work:</p>
  
  <pre><code>[TsClass]
  public class Bob&lt;T&gt;
  {
      public MyTestEnum MyEnum { get; set; }
      public string TestString { get; set; }
      public string MyProperty { get; set; }
  }
  
  [TsEnum]
  public enum MyTestEnum
  {
      One,
      Two,
      Three
  }
  </code></pre>
  
  <p>The problem is that I cannot have the combination of generics <code>&lt;T&gt;</code> and <code>Enum</code> in the same place. In order for it to work, i need to take out either one of them.</p>
  
  <p>This is the error it gives me when I run it:</p>
  
  <pre><code>Error   17  Running transformation: System.NullReferenceException: Object reference not set to an instance of an object.
     at TypeLite.TsModelBuilder.AddEnum(TsEnum tsEnum) in C:\___PROJECTS___\TypeLITE\TypeLite\TsModelBuilder.cs:line 98
     at TypeLite.TsModelBuilder.Add(Type clrType, Boolean includeReferences) in C:\___PROJECTS___\TypeLITE\TypeLite\TsModelBuilder.cs:line 83
     at TypeLite.TsModelBuilder.Add(Assembly assembly) in C:\___PROJECTS___\TypeLITE\TypeLite\TsModelBuilder.cs:line 108
     at TypeLite.Net4.TypeScriptFluentExtensions.ForLoadedAssemblies(TypeScriptFluent ts) in C:\___PROJECTS___\TypeLITE\TypeLite.Net4\TypeScriptFluentExtensions.cs:line 16
     at Microsoft.VisualStudio.TextTemplatingBDE10CD05B2CB4C5419DB79DDF5BA5BA06D673F55FF952439E5971D4E1F394085E3B6D99DC6D1E992221FAC06D0692FFD83BE54FE5AF6A567A491DF31AE26472.GeneratedTextTransformation.TransformText() ..\Scripts\TypeLite.Net4.tt
  </code></pre>
  
  <p>The fact that I'm not doing anything with generics is irrelevant (I'm just trying to make it work!)</p>
  
  <p>I'd appreciate if you know of a workaround or if you can introduce another utility similar to it that is capable of doing such thing.</p>
  
  <p>I've already reported this issue to the developers (hopefully Lukas address it sometime soon): <a href="https://bitbucket.org/LukasKabrt/typelite/issue/41/issue-with-generics-and-enums" rel="nofollow">https://bitbucket.org/LukasKabrt/typelite/issue/41/issue-with-generics-and-enums</a></p>