I'm generating interfaces with KotlinPoet with the following code
val funspec = FunSpec.builder("test").build()
val interfacespec = TypeSpec.interfaceBuilder("Test").addFunction(funspec).build()
This generates the following code:
interface Test {
fun test() {
}
}
The function test()
has a default implementation (has brackets). Is there any way to remove the default implementation (remove the brackets)?
So simply add .addModifiers(KModifier.ABSTRACT)
to your funspec
.