title: Detect if a generic type is open?
body: <p>I have a bunch of regular, closed and opened types in my assembly. I have a query that I'm trying to rule out the open types from it</p>
  
  <pre><code>class Foo { } // a regular type
  class Bar&lt;T, U&gt; { } // an open type
  class Moo : Bar&lt;int, string&gt; { } // a closed type
  
  var types = Assembly.GetExecutingAssembly().GetTypes().Where(t =&gt; ???);
  types.Foreach(t =&gt; ConsoleWriteLine(t.Name)); // should *not* output "Bar`2"
  </code></pre>
  
  <p>Upon debugging the generic arguments of an open type, I found that their <code>FullName</code> is null (as well as other things like the <code>DeclaringMethod</code>) - So this could be one way:</p>
  
  <pre><code>    bool IsOpenType(Type type)
      {
          if (!type.IsGenericType)
              return false;
          var args = type.GetGenericArguments();
          return args[0].FullName == null;
      }
  
      Console.WriteLine(IsOpenType(typeof(Bar&lt;,&gt;)));            // true
      Console.WriteLine(IsOpenType(typeof(Bar&lt;int, string&gt;)));  // false
  </code></pre>
  
  <p>Is there a built-in way to know if a type is open? if not, is there a better way to do it? Thanks.</p>