Burst error BC0102: Unexpected internal compiler error

Accidentally ran into an internal burst compile error while refactoring some code.

Error

Simple repo code

public struct TestData
{
    public int3 Min;
    public int Size;
}

[BurstCompile]
private struct Repo : IJob
{
    public NativeReference<TestData> Root;

    public void Execute()
    {
        this.FailMethod((TestData*)this.Root.GetUnsafePtr());
    }

    private void FailMethod(in TestData* node)
    {
        var aabb = new Unity.Mathematics.MinMaxAABB { Min = node->Min, Max = node->Size };
    }
}

The issue is just the

in TestData* node

Removing the ‘in’ and burst compiles fine.

This is a pretty irrelevant bug as the ‘in’ doesn’t do anything on a pointer as far as I’m aware, I was just refactoring a method and accidentally left it on.

Only reporting it just because as far as I’m aware this is technically valid code and the repo was very simple.

2 Likes

Good find! I can repro it, so I’ll fix it. Thanks!