void (AnnotationHolder holder, GrTypeDefinition definition) { if (!(definition instanceof GrClassDefinition)) return; List<PsiClass> selfTypeClasses = GrTraitUtil.getSelfTypeClasses(definition); for (PsiClass selfClass : selfTypeClasses) { if (InheritanceUtil.isInheritorOrSelf(definition, selfClass, true)) continue; String message = GroovyBundle.message("selfType.class.does.not.inherit", definition.getQualifiedName(), selfClass.getQualifiedName()); holder.newAnnotation(HighlightSeverity.ERROR, message).range(GrHighlightUtil.getClassHeaderTextRange(definition)).create(); break; } }