using System; using NUnit.Framework; using Unity.Burst; [TestFixture, BurstCompile] public class FunctionPointerTests { [BurstCompile(new[] { BurstCompilerOptions.DoNotEagerCompile }, CompileSynchronously = true)] private static T StaticFunctionNoArgsGenericReturnType() { return default; } private delegate int DelegateNoArgsIntReturnType(); [Test] public void TestCompileFunctionPointerNoArgsGenericReturnType() { Assert.Throws( () => BurstCompiler.CompileFunctionPointer(StaticFunctionNoArgsGenericReturnType), "The method `Int32 StaticFunctionNoArgsGenericReturnType[Int32]()` must be a non-generic method"); } }