-
Improvement
-
Resolution: Unresolved
-
Major
Full language coverage.
The remaining tasks should be driven by throw new UnsupportedOperationException in CpsTransformer.
- synchronized statements (maybe warn and ignore?)
- Method pointer expression
- List spread expression x=[2,3]; y=[1,*x,4]; assert y=[1,2,3,4]
- Map spread expression
- Spread method call: x = [1,2,3]; assert x*.toString() = ["1","2","3"]
- Safe method call: x=null; assert x?.foo()==null
See also comment in localMethodCallWithinLotsOfBranches.groovy.
Must also ensure that any exception in this area is properly reported as an error in the log, rather than simply killing the VM thread.
- depends on
-
JENKINS-33051 Groovy Star-Dot operator not supported in sandbox
-
- Open
-
-
JENKINS-27927 Some interface idioms do not work in Groovy CPS
-
- Open
-
-
JENKINS-27893 Varargs mishandled in Groovy CPS
-
- Resolved
-
- links to
Forgive me if part of this task is also adding the UnsupportedOperationException for these operators - only, the wording suggests the exception is already present, otherwise, I've stumbled across this because I tried to use a spread method call and received the following exception instead:
hudson.remoting.ProxyException: groovy.lang.MissingMethodException: No signature of method: java.util.Collections$UnmodifiableRandomAccessList.getShortDescription() is applicable for argument types: () values: []
I then tried to use collect, and of course found
(I switched to a for loop)
JENKINS-26481In both cases, it would be a huge advantage to someone learning Pipeline and Groovy if Jenkins would reject these with clear exceptions.