Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
In the case of a static groovy method call like File.createTempDir() when @CompileStatic is applied, StaticInvocationWriter's writeDirectMethodCall and loadArguments mutate the shared global constant node ConstantExpression.NULL.
Relevant bits:
protected boolean writeDirectMethodCall(final MethodNode target, final boolean implicitThis, final Expression receiver, final TupleExpression args) { ... if (target instanceof ExtensionMethodNode) { ... if (emn.isStaticExtension()) { // it's a static extension method argumentList.add(0, ConstantExpression.NULL); } else { .... } Parameter[] parameters = node.getParameters(); loadArguments(argumentList, parameters); ... protected void loadArguments(List<Expression> argumentList, Parameter[] para) { ... // This is repeated 3 times in the method: Expression expression = argumentList.get(i); expression.putNodeMetaData(PARAMETER_TYPE, para[i].getType());
Attachments
Attachments
Issue Links
- links to