String (PsiType type, GroovyPsiElement context, ExpressionContext expressionContext) { final DefaultGroovyVariableNameValidator nameValidator = new DefaultGroovyVariableNameValidator(context, expressionContext.myUsedVarNames, true, true); if (type instanceof PsiPrimitiveType) type = TypesUtil.boxPrimitiveType(type, context.getManager(), context.getResolveScope()); final String[] varNames = GroovyNameSuggestionUtil.suggestVariableNameByType(type, nameValidator); LOG.assertTrue(varNames.length > 0); expressionContext.myUsedVarNames.add(varNames[0]); return varNames[0]; }