Search Unity

Bug [IN-42692] BurstILPostProcessor cannot find method

Discussion in 'Burst' started by FaithlessOne, Jun 1, 2023.

  1. FaithlessOne

    FaithlessOne

    Joined:
    Jun 19, 2017
    Posts:
    324
    I want to report a bug, which is Burst related. It is happening using the following code:

    Code (CSharp):
    1.   public partial struct TestSystem : ISystem
    2.   {
    3.     [BurstCompile]
    4.     public void OnCreate(ref SystemState state)
    5.     {
    6.       state.RequireForUpdate<PhysicsWorldSingleton>();
    7.     }
    8.  
    9.     [BurstCompile]
    10.     public void OnUpdate(ref SystemState state)
    11.     {
    12.  
    13.     }
    14.  
    15.     [BurstCompile]
    16.     private void Failing(ref SystemState state, TestRefStruct<SomeTable, SomeStruct<SomeTable>> testRefStruct)
    17.     {
    18.       SystemAPI.GetSingleton<PhysicsWorldSingleton>();
    19.     }
    20.    
    21.     [BurstCompile]
    22.     public void OnDestroy(ref SystemState state)
    23.     {
    24.  
    25.     }
    26.   }
    27.  
    28.   public readonly ref struct TestRefStruct<T1, T2>
    29.     where T1 : unmanaged
    30.     where T2 : unmanaged
    31.   {
    32.     private readonly int _index;
    33.   }
    34.  
    35.   public struct SomeStruct<TElement>
    36.     where TElement : unmanaged
    37.   {
    38.   }
    39.  
    40.   public struct SomeTable
    41.   {
    42.   }
    The following error occurs on compiling the code above even with Burst disabled. It states that the method Failing cannot be found:

    Created a reproduction project in IN-42692. Used Burst 1.8.4 and Unity 2022.2.21f.