Burst does not show the compile error BC1021 in Console

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.

I get an error in console as soon I try run it

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

1 Like

Thats strange, cause my VS does not show any warnings, and no errors shown on play button
6119903--666815--NoWarnings.PNG

But there is correct error in Burst inspector.

And nothing in console or VS2019

PS. I am using Unity 2020.1.0b16, Visual Studio 16.6.4, Burst 1.4.0-preview2 (1.3.3 works the same)

As I said it’s a Rider feature. Rider provides a whole extra level of support for Unity these days over VS.

And it won’t show in console until you try and run the job (because it won’t compile until you run the job.)

1 Like

Now I understood, thank you so much. I just needed to run it to see error in Unity console. That was not very obvious for me :slight_smile: