gto*_*tod 5 intellij-idea kotlin
我有一个简单的Kotlin函数,它调用一些Java代码:
fun simpleSchema(field: GraphQLFieldDefinition) =
newSchema()
.query(newObject()
.name("root")
.field(field)
.build())
.build()
Run Code Online (Sandbox Code Playgroud)
在我的IDEA里面,即
IntelliJ IDEA 2016.2.5
Build #IU-162.2228.15, built on October 14, 2016
JRE: 1.8.0_112-release-287-b2 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Run Code Online (Sandbox Code Playgroud)
有一条有用的信息:
Declaration has platform type. Make the type explicit to prevent subtle bugs.
This inspection reports functions and properties that have platform type.
In order to prevent unexpected errors, the type should be declared explicitly.
Run Code Online (Sandbox Code Playgroud)
这很棒.但是在编辑器窗格的RHS上,此消息被标记为弱警告,我希望它是一个错误.我转到设置 - >编辑器 - >检查 - > Kotlin - >"功能或属性具有平台类型"并将其标记为错误.
为什么这不起作用?在检查中搜索"平台类型"显示没有比上述更可能的候选人.我重新启动并使缓存无效......
| 归档时间: |
|
| 查看次数: |
1388 次 |
| 最近记录: |