kotlin-dsl-samples icon indicating copy to clipboard operation
kotlin-dsl-samples copied to clipboard

KT-26923 - Can't decompile Kotlin Bytecode (to Java)

Open StefMa opened this issue 5 years ago • 2 comments

As a Kotlin learner I use sometimes the "Show Kotlin Bytecode" -> Decompile feature in IntelliJ to see the Java source code. bildschirmfoto 2018-09-17 um 14 47 39 bildschirmfoto 2018-09-17 um 14 47 48

Unfortunately IntelliJ doesn't recognize my build.gradle.kts file as Kotlin Source File which means the decompiled version is empty: bildschirmfoto 2018-09-17 um 14 48 47 (No, my build.gradle.kts is not empty 😹)

I don't know if this is an IntelliJ / Kotlin or Kotlin Plugin issue or an Kotlin DSL issue which just needs to report IntelliJ somehow that this is a Kotlin file 🤷‍♂️ Feel free to create a issue in the Kotlin Tracker or IntelliJ Tracker...

Expected Behavior

The decompiled version should show the Java Code from the decompiled Kotlin code.

Current Behavior

The decompiled version is empty.

Context

See the description above 👆

Steps to Reproduce (for bugs)

Create a build.gradle.kts and write something in it. Open this in IntelliJ and press CMD + Shift + A (on a Mac) and search for "Show Kotlin Bytecode". Press it. A window appear where you can click "Decompile". Click it. A new file appear which is empty.

Your Environment

IntelliJ IDEA 2018.2.3 (Community Edition) Build #IC-182.4323.46, built on September 3, 2018 JRE: 1.8.0_152-release-1248-b8 x86_64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o macOS 10.13.6

StefMa avatar Sep 17 '18 12:09 StefMa

Thanks for the report @StefMa!

This is an issue for the IntelliJ Kotlin Plugin. Could you please open an issue in JetBrains Youtrack https://youtrack.jetbrains.com/issues/KT and link it from here?

eskatos avatar Sep 18 '18 07:09 eskatos

✅ https://youtrack.jetbrains.com/issue/KT-26923

StefMa avatar Sep 18 '18 08:09 StefMa