Burst inspector showing methods that shouldn't be there

Unity 2021.3.16f1
Burst 1.7.4

The following method should be excluded when collections checks are off (ENABLE_UNITY_COLLECTIONS_CHECKS is false)

And yet calls to it show up in the decompiled code…

Hi @burningmime , does this issue also occur on Burst 1.8.2?

Just checked, and yes it does.

I can submit a repro project if it would be useful.

Actually, looking at this a bit more thoroughly, I realize this is expected behavior. Burst can’t know that your methods are considered safety-checks, because they’re not annotated as such. They’re only either included and excluded from the code that Burst compiles (based on whether ENABLE_UNITY_COLLECTIONS_CHECKS is set) before Burst gets it. The way Burst knows whether something is a safety-check is by annotating it with [Conditional("ENABLE_UNITY_COLLECTIONS_CHECKS")], so you can try that.