leandro
03/22/2021, 7:12 PMTing-Yuan Huang
03/22/2021, 7:24 PMleandro
03/22/2021, 7:43 PMpublic class MyEvent(foo: MyEnum) : Event {
override val name: String = "Event Name"
override val properties: Map<String, Any> = mapOf("Foo" to foo)
}
Would KSP not be able to grab the values name
and properties
?jw
03/22/2021, 7:53 PMleandro
03/22/2021, 8:04 PMyigit
03/22/2021, 8:18 PMconstnat evaluation
logic that is used for annotation values but as jake mentioned, everything else in that sample is a runtime value.
So even a compiler plugin cannot do that unless you implement some evaluation logic for those values (notice that, those values can be anything such that the classes used there may not be part of the compiler's own classpath)Fabio
03/29/2021, 10:53 AMclass CoffeeApp : KoinComponent {
val maker: CoffeeMaker by inject()
val aaa = "aaa"
val l by lazy { "lazy" }
}
I'd like to find all properties that use by inject()
. I don't need the value, I'd simply want to know whether maker
's value is going to be provided by DI, so I put that in a list. So far all I can do is is isDelegated
, but that's also true
for l by lazy
.jw
03/29/2021, 12:28 PMFabio
03/29/2021, 9:50 PMjw
03/30/2021, 2:12 AM