【问题标题】:KotlinPoet - No brackets for interface methodsKotlinPoet - 接口方法没有括号
【发布时间】: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


    【解决方案1】:
    猜你喜欢
    • 2013-12-13
    • 2017-07-21
    • 1970-01-01
    • 2014-01-19
    • 1970-01-01
    • 1970-01-01
    • 2014-06-02
    • 2012-05-01
    • 1970-01-01
    相关资源
    最近更新 更多