docs: protected void generateClosureDefinition(XClosure closure, IAppendable it, IExtraLanguageGeneratorContext context) {
  		if (!it.hasName(closure)) {
  			final LightweightTypeReference closureType0 = getExpectedType(closure);
  			LightweightTypeReference closureType = closureType0;
  			if (closureType0.isFunctionType()) {
  				final FunctionTypeReference fctRef = closureType0.tryConvertToFunctionTypeReference(true);
  				if (fctRef != null) {
  					closureType = Utils.toLightweightTypeReference(fctRef.getType(), this.typeServices).getRawTypeReference();
  				}
  			}
  			final String closureName = it.declareSyntheticVariable(closure, "__Jclosure_" //$NON-NLS-1$
  					+ closureType.getSimpleName());
  			final JvmDeclaredType rawType = (JvmDeclaredType) closureType.getType();
  			final JvmOperation function = rawType.getDeclaredOperations().iterator().next();
  			// Add the object type as super type because of an issue in the Python language.
  			final JvmTypeReference objType = getTypeReferences().getTypeForName(Object.class, closure);
  			it.openPseudoScope();
  			it.append("class ").append(closureName).append("(") //$NON-NLS-1$//$NON-NLS-2$
  				.append(closureType).append(",").append(objType.getType()).append("):") //$NON-NLS-1$ //$NON-NLS-2$
  				.increaseIndentation().newLine().append("def ") //$NON-NLS-1$
  				.append(function.getSimpleName()).append("(") //$NON-NLS-1$
  				.append(getExtraLanguageKeywordProvider().getThisKeywordLambda().apply());
  			for (final JvmFormalParameter param : closure.getFormalParameters()) {
  				it.append(", "); //$NON-NLS-1$
  				final String name = it.declareUniqueNameVariable(param, param.getName());
  				it.append(name);
  			}
  			it.append("):"); //$NON-NLS-1$
  			it.increaseIndentation().newLine();
  			if (closure.getExpression() != null) {
  				LightweightTypeReference returnType = closureType0;
  				if (returnType.isFunctionType()) {
  					final FunctionTypeReference fctRef = returnType.tryConvertToFunctionTypeReference(true);
  					if (fctRef != null) {
  						returnType = fctRef.getReturnType();
  					} else {
  						returnType = null;
  					}
  				} else {
  					returnType = null;
  				}
  				//LightweightTypeReference returnType = getClosureOperationReturnType(type, operation);
  				generate(closure.getExpression(), returnType, it, context);
  			} else {
  				it.append("pass"); //$NON-NLS-1$
  			}
  			it.decreaseIndentation().decreaseIndentation().newLine();
  			it.closeScope();
  		}
  	}