void (@NotNull GrUnaryExpression expression) { if (expression.getOperationTokenType() == GroovyTokenTypes.mINC || expression.getOperationTokenType() == GroovyTokenTypes.mDEC) { GrExpression operand = expression.getOperand(); if (operand instanceof GrReferenceExpression && ((GrReferenceExpression)operand).getQualifier() == null) { GrTraitTypeDefinition trait = PsiTreeUtil.getParentOfType(operand, GrTraitTypeDefinition.class); if (trait != null) { PsiElement resolved = ((GrReferenceExpression)operand).resolve(); if (resolved instanceof GrField && ((GrField)resolved).getContainingClass() instanceof GrTraitTypeDefinition) { myHolder.newAnnotation(HighlightSeverity.ERROR, GroovyBundle .message("0.expressions.on.trait.fields.properties.are.not.supported.in.traits", expression.getOperationToken().getText())).create(); } } } } }