ContractAnnotation halt not working

Hi, I’m trying to use a ContractAnnotation to halt execution and it’s not working.
UnityEngine.Assertions.Assert.IsTrue(condition, message) has a ContractAnnotation to halt that does work, and I’m trying to do the same thing.
I’ve used the same annotation and tried others such as [ContractAnnotation(“=>halt”)] but it doesn’t seem to work.
I’m using Unity 6000.0.40f1 on Windows 11 and only running it in the editor(I don’t need it to run outside of the editor). I think I read somewhere that Unity has a version of the Jetbrains code in a UnityEngine.CoreModule.dll but I didn’t really understand what it meant.

In the following code, replacing the CustomAssert call with the Unity version prevents the second log message. That’s what I’m trying to do with my function.

Any help would be appreciated.

[ContractAnnotation("condition:false=>halt")]
public static void CustomAssert(bool condition)
{
	...
}

SomeFunction()
{
	Debug.Log("first message that should log");
	
	CustomAssert(1 == 2);

	Debug.Log("second message that should not be shown");
}

I’ve never heard of the ContractAnnotationAttribute but my little buddy ChatGPT tells me that it is largely for static code analysis, unless you integrate all the Jet-For-Brains stuff properly:

However, Unity does not natively support these annotations at runtime—they are purely for development-time tooling. If you’re not using ReSharper or Rider, adding these annotations won’t have any impact.

EDIT: I’ve never done it but I suppose you could write a little thing that uses Reflection to find your attributes and then does stuff based on the arguments to the attribute… you’d need to parse that string and decide what is what… who knows, there might even be an open-source “mini jet-for-brains” package out there on github!