java转kotlin
Shift + Alt + Cmd + k
Mac
Shift + Alt + Ctrl + k
Windows
如下图所示:
这里记录下java一键转kotlin遇到的几个错误:
1.Overload resolution ambiguity. All these functions match
原因:名字冲突。编译器不知道引用哪一个
参考链接1
2.Smart cast to 'Type' is impossible, because 'variable' is a mutable property that could have been changed by this time
参考链接2
Kotlin转java(转换后只供参考,不能直接使用)
kotlin转java 只能看到反编译的源码,博主暂时不太清楚有没有直接转java的,有的话麻烦大佬指教下
Tools>Kotlin>Show Kotlin Bytecode
Decompile