boolean (GrClosureSignatureUtil.ArgInfo<PsiElement> arg, GrClosureParameter param) { boolean argExists = !arg.args.isEmpty() && arg.args.get(0) != null; if (argExists) { final PsiElement actual = arg.args.get(0); LOG.assertTrue(actual instanceof GrExpression); final PsiType type = param.getType(); final PsiType declaredType = GenerationUtil.getDeclaredType((GrExpression)actual, myExpressionGenerator.getContext()); if (type != null && declaredType != null && !TypesUtil.isAssignableByMethodCallConversion(type, declaredType, actual )) { myBuilder.append('('); TypeWriter.writeType(myBuilder, type, actual); myBuilder.append(')'); } ((GrExpression)actual).accept(myExpressionGenerator); return true; } else { /*final GrExpression initializer = param.getInitializerGroovy(); if (initializer != null) { initializer.accept(myExpressionGenerator); } else { myBuilder.append("???"); //todo add something more consistent }*/ return false; } }