Hi!
I would like to ask someone with experience of using C#'s standard Contracts in Unity:
a) How well does Ensures, Requires, Invariant, OldValue work in Unity?
b) Does the static analysis work as expected?
c) What is the support for this in release?
d) Is there some more significant performance hit?
I am asking because I only found one post of someone saying that something from Contracts does not work and not much else about it.
I know about the Unity’s own Assertion library, that it is built to work nicely with Unity’s ecosystem, that they are pretty light-weight and so on. But Contracts are much more powerful and I’d like to use them, so are there any big downsides compared to the Assertion library?
Background info: I’m currently working on a piece of code that I might consider releasing later as a library/asset. To that end I thought it would be good to use some Assertions or Contracts.