Currently, there seem to be numerous features of Groovy that simply do not work when used in Jenkinsfiles or associated scripts.
Even really basic things such as groovy-style iterators are not suppported: something I wasted a lot of time on until I finally came across https://issues.jenkins-ci.org/browse/JENKINS-26481
I wrote a nifty thing that uses inheritance, got "General error during canonicalisation: Unexpected variable type: null", and then finally found https://issues.jenkins-ci.org/browse/JENKINS-34428 - apparently calls to super don't work, either.
Writing nontrivial Jenkinsfiles currently involves a cycle in which you write your code, it produces a confusing crash in the CPS engine, you go hunting, eventually find a bug report, remove the offending language feature, and repeat.
This is not fun.
Can we please have documentation stating which subset of the Groovy language actually works?
Even better: where it is possible to do so simply (such as for inheritance) can we please have a nice readable error message instead of an incomprehensible one?