@Nullable @Override public PsiType fun(GrUnaryExpressionImpl unary) { final GroovyResolveResult resolveResult = PsiImplUtil.extractUniqueResult(unary.multiResolve(false)); if (isIncDecNumber(resolveResult)) { return unary.getOperand().getType(); } final PsiType substituted = ResolveUtil.extractReturnTypeFromCandidate(resolveResult, unary, PsiType.EMPTY_ARRAY); if (substituted != null) { return substituted; } GrExpression operand = unary.getOperand(); if (operand == null) return null; final PsiType type = operand.getType(); if (TypesUtil.isNumericType(type)) { return type; } return null; }
@NotNull @Override public GroovyResolveResult[] resolve( @NotNull GrUnaryExpressionImpl unary, boolean incompleteCode) { final GrExpression operand = unary.getOperand(); if (operand == null) return GroovyResolveResult.EMPTY_ARRAY; final PsiType type = operand.getType(); if (type == null) return GroovyResolveResult.EMPTY_ARRAY; return TypesUtil.getOverloadedUnaryOperatorCandidates( type, unary.getOperationTokenType(), operand, PsiType.EMPTY_ARRAY); }