title: JsonConvert serialize/deserialize jagged array with TypeNameHandling enabled
body: <p>I am trying to deserialize an object with a jagged and multidimensional array property:</p>
  
  <pre><code>public abstract class Foo {}
  
  public class Baz
  {
      public readonly List&lt;Foo&gt; Foos;
  
      public Baz()
      {
          Foos = new List&lt;Foo&gt;();
      }
  }
  
  public class Bar : Foo
  {
      public readonly double[][,,] Values;
  
      public Bar(double[][,,] values)
      {
          Values = values;
      }
  }
  </code></pre>
  
  <p>Since <code>Baz</code> has a <code>List&lt;Foo&gt;</code> and <code>Foo</code> is an abstract class, I want to preserve types of Foo's in the serialized string, so I have to use <code>TypeNameHandling.All</code>:</p>
  
  <pre><code>JsonSerializerSettings settings = new JsonSerializerSettings
  {
      TypeNameHandling = TypeNameHandling.All,
      Formatting = Formatting.Indented
  };
  </code></pre>
  
  <p>However, when I run the following code:</p>
  
  <pre><code>var barValues = new double[][,,] { new double[,,] {{{ 1 }}} };
  
  var baz = new Baz();
  baz.Foos.Add(new Bar(barValues));
  
  var json = JsonConvert.SerializeObject(baz, settings);
  var baz2 = JsonConvert.DeserializeObject&lt;Baz&gt;(json, settings);
  </code></pre>
  
  <p>I got an exception:</p>
  
  <blockquote>
    <p>Type specified in JSON 'System.Double[,][], System.Private.CoreLib,
    Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' is
    not compatible with 'System.Double[,,][], System.Private.CoreLib,
    Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'.
    Path 'Foos.$values[0].Values.$type', line 9, position 63.'</p>
  </blockquote>
  
  <p>And if I inspect the serialized string, it looks rather strange:</p>
  
  <pre><code>"Values": {
     "$type": "System.Double[,][], System.Private.CoreLib",
     ...
  }
  </code></pre>
  
  <p>Why <code>JsonConvert</code> can not deserialize the string in that case ?</p>