0.11 Bug: Debug.Assert false trigger

I seem to have found a bug with Debug.Assert. On doing a boolean check, it does an assert even though the evaluation should have been false…

If I’m looking at your program right, it’s behaving as expected. Since IsCompressorOn evaluates to false, you’re checking if false == true, which it doesn’t. According to Debug.Assert Method (System.Diagnostics) | Microsoft Learn the assert should trigger when condition is false, not true.

I believe you want p.IsCompressorOn == false or !p.IsCompressorOn. You’re asserting that it’s not on.