title: Derived types must either match the security accessibility of the base type or be less accessible in very basic case
body: <p>Build <a href="https://jurassic.codeplex.com/SourceControl/network/forks/LostTheBlack/Jast/changeset/c8d4cc4838e1" rel="nofollow noreferrer">the sample code</a>, and run any test. (I tried <code>abs</code>.)</p>
  <p>Each time I do it, I get <code>TypeLoadException</code>:</p>
  <blockquote>
  <p>An exception of type 'System.TypeLoadException' occurred in Jurassic.dll but was not handled in user code</p>
  <p>Additional information: Inheritance security rules violated by type: 'Jurassic.Compiler.WhiteSpaceToken'. Derived types must either match the security accessibility of the base type or be less accessible.</p>
  </blockquote>
  <p>The problem is <code>WhiteSpaceToken</code> is a simple class, as so is <code>Token</code>, its base. So it looks like exception is not actually providing accurate information about the class name, and the error is probably caused by some other code.</p>
  <p>My understanding is nearly 0 at this case. The only explanation I could possibly imagine is that you can't inherit an abstract class from portable library, but I've never heard about this kind of restriction.</p>
  <p>Any ideas why is this happening?</p>
  <p>P.S. Adding some quick info about code structure, as requested in comment</p>
  <ol>
  <li>Token class is a public abstract class in a portable library targeted to .NET 4, Silverlight 5, Windows 8, and Windows Phone 8. It only works with string class from <code>mscorlib</code>.</li>
  <li><code>WhiteSpaceToken</code> is in a normal assembly, targeted to .NET 4. It inherits from <code>Token</code>. Also only works with <code>int</code> and <code>string</code>.</li>
  <li>Neither class has any attributes in its code.</li>
  <li>The unit test assembly is a normal unit test assembly on MSTest targeted 4.0</li>
  </ol>