I found a bug when the Code Generator tries to create corresponding functionalities of a component which uses a generic type parameter. Here is my components:
using Entitas;
public interface ITaskComponent : IComponent {}
public interface ITaskDataComponent : IComponent {}
[DontGenerate(false)]
public class OperationalTaskComponent<T> : ITaskComponent where T : class, ITaskDataComponent
{
public long startTick;
public long endTick;
public float progress;
public float activeRate;
public T taskData;
}
public class SomeTask : OperationalTaskComponent<SomeTaskData> {}
As you can see in the above code, I have used DontGenerate attribute in order to avoid code generation for this class, but when I hit the Generate menu, it says:
Argument cannot be null. Parameter name: key
At first, it was not clear for me that the cause of the error is lied behind this Generic Component super class thing, but after some investigation I found out that the problem happens in ToCompilableString method of DesperateDevs.Utils.SerializationTypeExtension where the Generic type is being processed. I think you should have some error logging and avoid using catch (Exception) with no logs.
Anyway, can you guide me how to use some hierarchical structure like this in my codes?
Hi,
I found a bug when the Code Generator tries to create corresponding functionalities of a component which uses a generic type parameter. Here is my components:
As you can see in the above code, I have used
DontGenerate
attribute in order to avoid code generation for this class, but when I hit the Generate menu, it says:Argument cannot be null. Parameter name: key
At first, it was not clear for me that the cause of the error is lied behind this Generic Component super class thing, but after some investigation I found out that the problem happens in
ToCompilableString
method ofDesperateDevs.Utils.SerializationTypeExtension
where the Generic type is being processed. I think you should have some error logging and avoid usingcatch (Exception)
with no logs.Anyway, can you guide me how to use some hierarchical structure like this in my codes?
Cheers