I have a generic method like this:
public class MyClass
{
public T MyMethod<T>(string arg)
{
return default(T);
}
}
When I try to call the method like this:
int someInt = MyClassInstance.MyMethod<int>("some_string");
I get the following error:
Attempting to JIT compile method 'MyClass.MyMethod<int> (string)' while running with --aot-only.
This also happens to bool and float types but it works for string.
Would you guys know why this happens? Thanks!