Getting type from a symbol in roslyn
<p>What is the best general purpose way to get a System.Type from Microsoft.CodeAnalysis.ISymbol for different types of symbols ? (e.g. class declarations, variable, properties, etc)</p>

<p>I want to be able to do various checks on the type e.g. as checking if the type implements any interface or is cast-able to any interface, just like one can check on System.Type.</p>

<p>The problem I am having is that most of the concrete classes used to represent the symbol are internal (see <a href="http://sourceroslyn.io/" rel="noreferrer">http://sourceroslyn.io/</a>) and I could not find tye type information in the ISymbol.</p>

<ul>
<li>SourceNamedTypeSymbol</li>
<li>LocalSymbol</li>
</ul>

<p>I retrieve the ISymbol using the following code</p>

<pre><code>var objectSymbol = (ISymbol)model.GetDeclaredSymbol(obj.Node);
</code></pre>