Can anybody please help me with burst compiler?
The problem is:
I use burst compiler, but it does not inform me about doing something he cannot compile. It shows this information only its own inspector.
Maybe there is any setting for this?
[BurstCompile(CompileSynchronously = true, Debug = true, FloatMode = FloatMode.Fast, FloatPrecision = FloatPrecision.Low)]
public struct CutWithPlaneJob : IJob
{
public void Execute()
{
List<float> a = new List<float>();
}
}
This code should generate checked exception (at compile time) but it does not.
X.cs(48,13): Burst error BC1021: Creating a managed object `System.Void System.Collections.Generic.List`1<System.Single>::.ctor()` is not supported
at X.CutWithPlaneJob.Execute(X.CutWithPlaneJob* this) (at X.cs:48)
at Unity.Jobs.IJobExtensions.JobStruct`1<X.CutWithPlaneJob>.Execute(ref X.CutWithPlaneJob data, System.IntPtr additionalPtr, System.IntPtr bufferRangePatchData, ref Unity.Jobs.LowLevel.Unsafe.JobRanges ranges, int jobIndex)
While compiling job: System.Void Unity.Jobs.IJobExtensions/JobStruct`1<X/CutWithPlaneJob>::Execute(T&,System.IntPtr,System.IntPtr,Unity.Jobs.LowLevel.Unsafe.JobRanges&,System.Int32)
at X.cs:line 48
Burst won’t throw an error till it actually tries to compile it, which in the new 1.4 preview it will do on code change but currently doesn’t do till playing.
Also the 2020.2 EAP version of Rider has static analysis for burst