https://kotlinlang.org logo
Title
a

Arnav Gupta

06/01/2020, 12:31 PM
I had a query regarding annotation processing. Say I have an interface like this
@Persistable
interface Vehicle {
	
	var wheels: Int

	var color: String

	@Optional
	var automatic: Boolean
}
If I find all elements annotated with
@Persistable
and I find
Vehicle
Now if I want to find all properties annotated with
@Optional
inside it, what is the best way to go about it ? As I understand, there will atually be a synthetic void method
automatic$annotations
created inside the
DefaultImpls
Is there a way from the
Metadata
to do what I am trying to ?
z

Zac Sweers

06/16/2020, 6:57 AM
Possibly but you won't be able to read synthetic elements from an annotation processor. Those annotation holder methods often are synthetic