void (@NotNull final GrUnaryExpression expression) { TypeConstraint constraint = new TypeConstraint(PsiTypes.intType()) { @Override public boolean satisfied(PsiType type, @NotNull PsiElement context) { final PsiType boxed = TypesUtil.boxPrimitiveType(type, context.getManager(), context.getResolveScope()); final GroovyMethodCallReference reference = expression.getReference(); return !resolveWithArguments(new JustTypeArgument(boxed), reference.getMethodName(), reference.getArguments(), reference.getElement()).isEmpty(); } @NotNull @Override public PsiType getDefaultType() { return PsiTypes.intType(); } }; myResult = new TypeConstraint[]{constraint}; }