我正在尝试构建Query Projection,但遇到了以下错误消息: Type mismatch: inferred type is KClass<GenderStatistics> but Classwas expected 导致问题的代码: fun status(): String { select g.abbr asg.abbr, g.description
""".trimIndent
我在play.kotlinlang.org上运行了以下代码,但结果仍然是:Type mismatch: inferred type is Unit but String is expected (我对原始示例代码做了一些更改) 我不知道为什么它的推断类型是Unit。我想我已经将返回类型声明为String。是println()单元的类型还是我刚刚写错了整个ring函数?