【发布时间】:2019-05-24 11:40:39
【问题描述】:
我正在使用以下代码使用 KotlinPoet 生成接口
val funspec = FunSpec.builder("test").build()
val interfacespec = TypeSpec.interfaceBuilder("Test").addFunction(funspec).build()
这会生成以下代码:
interface Test {
fun test() {
}
}
函数test() 有一个默认实现(有括号)。有什么办法可以去掉默认实现(去掉括号)?
【问题讨论】:
标签: kotlin kotlinpoet