Change logic of loading "suppress" annotation class descriptor
Instead of loading the descriptor and checking equals(), we now check if the annotation is in fact "suppress" by simply comparing its FQ name. This allows us to suppress warnings while compiling built-ins: the problem is that built-ins have its own "suppress" annotation class (defined in the sources) which differs from the one loaded by the compiler (from kotlin-compiler.jar)
This commit is contained in:
@@ -135,11 +135,10 @@ public class KotlinSuppressIntentionAction(
|
||||
private fun suppressAnnotationText(id: String) = "[suppress($id)]"
|
||||
|
||||
private fun findSuppressAnnotation(annotated: JetAnnotated): JetAnnotationEntry? {
|
||||
val suppressAnnotationClass = KotlinBuiltIns.getInstance().getSuppressAnnotationClass()
|
||||
val context = AnalyzerFacadeWithCache.getContextForElement(annotated)
|
||||
for (entry in annotated.getAnnotationEntries()) {
|
||||
val annotationDescriptor = context.get(BindingContext.ANNOTATION, entry)
|
||||
if (annotationDescriptor != null && suppressAnnotationClass.getTypeConstructor() == annotationDescriptor.getType().getConstructor()) {
|
||||
if (annotationDescriptor != null && KotlinBuiltIns.getInstance().isSuppressAnnotation(annotationDescriptor)) {
|
||||
return entry
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user