AndroidStudio java和kotlin相互转化
java转kotlinShift + Alt + Cmd + k
MacShift + 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
Tools>Kotlin>Show Kotlin Bytecode
Decompile