You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In KSP1, all instance of a KSDeclaration for the same declaration were equal (this is a similar to the expectation in javac for Element instances).
However, in KSP2 we can get two different (non-equal) instances for the same declaration depending on if we get the instance using Resolver#getClassDeclarationByName() or Resolver#getSymbolsWithAnnotation(), e.g. suppose we have:
@MyAnnotation classMyClass
And the following processor:
overridefunprocess(resolver:Resolver): List<KSAnnotated> {
val declaration1 = resolver.getSymbolsWithAnnotation("MyAnnotation").single()
val declaration2 = resolver.getClassDeclarationByName( resolver.getKSNameFromString("MyClass"))!!println("declaration1.equals(declaration2): ${declaration1.equals(declaration2)}")
returnlistOf()
}
In KSP1, all instance of a
KSDeclaration
for the same declaration were equal (this is a similar to the expectation in javac forElement
instances).However, in KSP2 we can get two different (non-equal) instances for the same declaration depending on if we get the instance using
Resolver#getClassDeclarationByName()
orResolver#getSymbolsWithAnnotation()
, e.g. suppose we have:And the following processor:
This results in:
The text was updated successfully, but these errors were encountered: