Bug 8379 - JIT exception when calling generic method with value type on inherited generic class
Summary: JIT exception when calling generic method with value type on inherited generi...
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: XI runtime ()
Version: 6.0.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-11-13 16:53 UTC by jason.hardman
Modified: 2013-05-31 08:26 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description jason.hardman 2012-11-13 16:53:18 UTC
JIT exceptions occur when a child class inherits from a generic base class and the base class executes a generic method with a value type on itself or its own base class.
e.g.

  var test1 = new Base<int>(); //OK
  var test2 = new Class1();  //JIT exception when initializing IntList

  public class Base<T>
  {
    public static List<P> CreateList<P>()
    {
      return new List<P>();
    }

    public static List<string> StringList = CreateList<string>();
    public static List<int> IntList = CreateList<int>();
  }

  public class Class1 : Base<Class1> {  }
Comment 1 Sebastien Pouliot 2013-05-31 08:26:51 UTC
This still fails in 6.2.6 but it works using 6.3.x.

The 6.3.x beta releases have much improved to avoid this situation (the EngineExecutionException). You might want to try this, or similar code, again and report any remaining issues (with a test case).