I’m using the last version of Entities 0.5. Code for reproducing the issue is simple, and authoring is not required to see the crash:
[assembly: RegisterGenericComponentType(typeof(GenericComponent<int>))]
namespace Assets
{
public struct GenericComponent<T> : IComponentData
where T : struct
{
public float Value;
}
public class SystemWithGenericComponent : JobComponentSystem
{
protected override JobHandle OnUpdate(JobHandle inputDeps)
{
return Entities
.ForEach((in GenericComponent<int> cGeneric) =>
{
// Some work...
}).Schedule(inputDeps);
}
}
}
After running any scene the Editor crashes immediately. The editor log shows some exception in Mono:
* Assertion at ..\mono\mini\method-to-ir.c:8462, condition `!mono_method_check_context_used (cmethod)' not met
So, if I have Entities.ForEach with a generic component, the entire project will broken. Jobs as structs with generic components are working properly.