SharedStatic and generics

Hi. I recently upgraded Burst to 1.3.3 and I noticed that SharedStatic now only seems to work with unmanaged types. This is unlike the previous version of the compiler I used (1.0.0). Is this change intentional and to stay? I checked SharedStatics metadata and at least there, the constrain on generic type is still “struct” (and not “unmanaged”). I was using them (among other things) with NativeArrays (SharedStatic<NativeArray>) for interopability with an external dll written in C. Am I now stuck with an outdated version of the compiler?

I found something in the changelog:

[1.3.0-preview.11] - 2020-04-30

  • The compiler is now generating a proper compiler error if a managed type used directly or indirectly with SharedStatic.

So it seems to be intentional? Why exactly did it also include NativeArrays and other generic types? It confuses me because our code seemed to be working correctly prior to updating the compiler to 1.3.3

So, I think I figured it out.
The constraint seems to still be “struct”. Which means generics are allowed. What’s not allowed is managed objects within structs (for NativeArray in particular these seem to be the objects used for safety checks). I’m not sure why it still worked regardless but changing NativeArray to a custom implementation that doesn’t have those safety handlers makes it possible to keep generic arrays inside SharedStatic.