Shader.PropertyToID & Fast but no Exceptions error!

On iOS when setting Script Call Optimization to “Fast but no Exceptions”, the app crashes. I use PropertyToID in a static class.

I would love to get some feedback on this.

Have you checked that you are not calling the PropertyToID in a field intializer or constructor like the error says? Example:

class MyClass: MonoBehaviour {
    public int someID = Shader.PropertyToID ("someProperty");

    MyClass(){
        someID = Shader.PropertyToID ("someProperty");
    }
}

I am calling it in a Field Initializer. This is a static class and I am getting those ID to avoid having to access material properties via strings which is slower. I understand why I get the error since this is trying to access a Unity function outside of the main thread.

Is there a reason why this class is not called by Unity on the main thread when “Fast but no Exceptions” is used?

P.S. At some point it would be nice to be able to call Unity functions from any threads.