Ahmed Mourad
03/30/2020, 5:58 AMclass MySyntheticResolveExtension : SyntheticResolveExtension {
override fun generateSyntheticMethods(
thisDescriptor: ClassDescriptor,
name: Name,
bindingContext: BindingContext,
fromSupertypes: List<SimpleFunctionDescriptor>,
result: MutableCollection<SimpleFunctionDescriptor>
) {
result.lastOrNull()?.let { lastDescriptor ->
val newCopy = lastDescriptor.createCustomCopy {
it.newCopyBuilder().setVisibility(visibility)
}
result.remove(lastDescriptor)
result.add(newCopy)
}
}
}
But this spawns some problems when changing the visibility to internal
where it tries to call a synthetic
function that does not exist.
Is there a better way to do this? or maybe a way to fix this?
Slack Conversation