rnett
05/18/2020, 3:43 AMclass KlairvoyantResolveExtension() : SyntheticResolveExtension {
override fun generateSyntheticProperties(thisDescriptor: ClassDescriptor, name: Name, bindingContext: BindingContext, fromSupertypes: ArrayList<PropertyDescriptor>, result: MutableSet<PropertyDescriptor>) {
if (!thisDescriptor.hasWatchAnnotation())
return
if(result.any { it.name == Name.identifier(Names.ClassWatcherProp) })
return
with(FrontendReferencer(thisDescriptor.module)) {
val classWatcherDescriptor = SimpleSyntheticPropertyDescriptor(thisDescriptor, Names.ClassWatcherProp, KotlinTypeFactory.simpleNotNullType(Annotations.EMPTY, CompositeWatcher, listOf()), visibility = Visibilities.PUBLIC)
result.add(classWatcherDescriptor)
}
}
}
shikasd
05/18/2020, 4:04 AMrnett
05/18/2020, 4:25 AMtest.id
is turning into get_field(test, custom_field)
. The turning into get_field is fine otherwise. I'm not touching the other properties until the IR phase (and it doesn't get there with this).rnett
05/19/2020, 12:24 AM