Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>In practice the terminology doesn't really matter much - I can't remember the last time I had to worry about it <em>except</em> when trying to write about it.</p> <ul> <li>An <em>unbound</em> type has no type arguments specified</li> <li>A <em>constructed</em> type has at least one type argument specified</li> <li>A type parameter is an <em>open type</em></li> <li>An array type where the element type is open is an <em>open type</em></li> <li>An <em>open</em> constructed type has at least one type argument which is an open type</li> <li>A <em>closed</em> type is any type which isn't open</li> </ul> <p>(There are further rules for nested types. Consult the C# 3.0 spec section 4.4 for gory details.)</p> <p>As an example of an open constructed type, consider:</p> <pre><code>public class NameDictionary&lt;T&gt; : Dictionary&lt;string, T&gt; </code></pre> <p>The base class of <code>typeof(NameDictionary&lt;&gt;)</code> is:</p> <ul> <li>Constructed because it specifies type arguments</li> <li>Open because the second type argument (<code>T</code>) is an open type</li> </ul> <p>The MSDN docs for <a href="http://msdn.microsoft.com/en-us/library/system.type.isgenerictype.aspx" rel="noreferrer"><code>Type.IsGenericType</code></a> have quite a useful little table.</p> <p>Just to reiterate, this is almost entirely unimportant in day to day use.</p> <p>I'm generally in favour of knowing the correct terminology - particularly for things like "pass by reference" etc - but in this case it really, really doesn't come up very often. I would like to actively discourage you from worrying about it :)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload