Compiler option to include local variables tables in class files


Is there any option on the kotlin compiler (preferably accessible from the command line) that will result in local variables tables being included in the generated class files, as done by the javac -g option?

The names of some of the compiler test files in the source repository make me hope that such an option exists (e.g. kotlin-master/compiler/testData/checkLocalVariablesTable/inlineLambdaWithItParam.kt), but perhaps these tests involve in memory compiler data and not the resulting bytecode.

I have been decompiling kotlin class files to better understand how certain language features are implemented, and having local variables tables included in the class files would help with this.


Kotlin compiler generates local variable tables by default. In fact, there’s currently no option to turn it off. Do you have a sample where this information is missing from the class file?


My apologies, the local variables tables are present in my class files.

I was misreading problems that were occurring the decompiler I am using and jumped to the incorrect assumption that local variable names were not there when in fact they were. I think I’ll move my work into intellij where the decompiler might work better.