Closed
Description
Prerequisites
- I have written a descriptive issue title
- I have verified that I am running the latest version of ImageSharp
- I have verified if the problem exist in both
DEBUG
andRELEASE
mode - I have searched open and closed issues to ensure it has not already been reported
Description
This is related to a lot of the AOT -> JIT bugs that have been written lately... I've been looking into iOS AOT errors more, and found some documentation of how to solve them (in the Unity docs of all places):
https://docs.unity3d.com/Manual/ScriptingRestrictions.html
ImageSharp has the AOTCompilerTools.Seed<TPixel>()
method that can be called to pre-seed the AOT compiler, however that method never actually has to be called. I've verified that a call to that method only has to exist in the codebase with the correct generic type, and the AOT compiler will pick it up:
private static void NeverCallThisMethod()
{
AotCompilerTools.Seed<Rgba32>();
throw new Exception("Don't call AotCompilerTools.NeverCallThisMethod(), it only exists to preseed the AOT compiler.");
}
^ This totally works, and wouldn't force ImageSharp users to use troubleshoot confusing AOT compiler errors. I'd be happy to clean up this code and create a PR for it.
Steps to Reproduce
System Configuration
- ImageSharp version: This is on the tip of master
- Other ImageSharp packages and versions:
- Environment (Operating system, version and so on): iOS
- .NET Framework version:
- Additional information: