Beef icon indicating copy to clipboard operation
Beef copied to clipboard

[BeefBuild][Crash] Failure during codegen for if-statement (callback?.Invoke() case .Err)

Open kallisto56 opened this issue 3 years ago • 0 comments

Hi there,

After starting debugging or when trying to compile workspace with BeefBuild.exe, it will crash because of the callback null-check inside if-statement with result check. This happens only when case is used. For example if (callback?.Invoke() == .Err) works perfectly fine.

attachment: callback-crash-dump.zip

namespace TestProject
{
	using System;


	public static class Program
	{
		public delegate Result<void> Delegate();
		public static Delegate callback;

		static void Main ()
		{
			if (callback?.Invoke() case .Err) {}
		}
	}
}

kallisto56 avatar Oct 29 '22 21:10 kallisto56