title: Problem with AOT (ahead of time) in a generic method after built to UWP and Il2CPP
body: <p>I have a generic method for trying to get a generic value from a dictionary via key using my own <code>TryGetValue</code> like (of course cropped a lot to the essential)</p>
  
  <pre><code>public class BaseExample
  {
      public virtual bool TryGetValue&lt;T&gt;(string key, out T value)
      {
          value = default;
          return false;
      }
  }
  
  public class Example : BaseExample
  {
      private Dictionary&lt;string, Item&gt; _items = new Dictionary&lt;string, Item&gt;();
  
      public override bool TryGetValue&lt;T&gt;(string key, out T value)
      {
          value = default;
          if (!GetItem(key, value, out var setting)) { return false; }
  
          value = (T)setting.Value;
          return true;
      } 
  
      private bool GetItem&lt;T&gt;(string key, T value, out Item item)
      {
          item = null;
  
          if (!_items.ContainsKey(key))
          {
              item = null;
              return false;
          }
  
          item = _items[key];
  
          return true;
      }
  }
  </code></pre>
  
  <p>This works in the Unity Editor but as soon as this is built to UWP and IL2CPP as soon as I try to run the method with e.g.</p>
  
  <pre><code>var value = example.TryGetValue&lt;int&gt;("SomeKey");
  </code></pre>
  
  <p>It throws a</p>
  
  <pre><code> System.ExecutionEngineException: Attempting to call method 'Example::TryGetValue&lt;System.Int32&gt;' for which no ahead of time (AOT) code was generated.
  </code></pre>
  
  <p><strong>What could be the reason for this and how can I fix it?</strong></p>