1.4.20 Kotlin/JS IR fails to link compilable code ...
# javascript
a
1.4.20 Kotlin/JS IR fails to link compilable code from different modules I am using 1.4.20 (IR) and I have a scenario where task
compileKotlinJs
compiles successfully and
compileDevelopmentExecutableKotlinJs
fails to compile. With the error
Copy code
> Task :webpage:compileDevelopmentExecutableKotlinJs FAILED
e: java.lang.IllegalStateException: org.jetbrains.kotlin.ir.descriptors.WrappedSimpleFunctionDescriptor@1b8f6db5 is not bound
        at org.jetbrains.kotlin.ir.descriptors.WrappedDeclarationDescriptor.getOwner(WrappedDescriptors.kt:96)
        at org.jetbrains.kotlin.ir.descriptors.WrappedSimpleFunctionDescriptor.getContainingDeclaration(WrappedDescriptors.kt:370)
        at org.jetbrains.kotlin.resolve.DescriptorUtils.getContainingModuleOrNull(DescriptorUtils.java:200)
        at org.jetbrains.kotlin.resolve.DescriptorUtils.getContainingModule(DescriptorUtils.java:185)
        at org.jetbrains.kotlin.resolve.descriptorUtil.DescriptorUtilsKt.getModule(DescriptorUtils.kt:64)
        at org.jetbrains.kotlin.backend.common.serialization.KotlinIrLinker.findDeserializedDeclarationForSymbol(KotlinIrLinker.kt:523)
        at org.jetbrains.kotlin.backend.common.serialization.KotlinIrLinker.getDeclaration(KotlinIrLinker.kt:566)
        at org.jetbrains.kotlin.ir.util.ExternalDependenciesGeneratorKt.getDeclaration(ExternalDependenciesGenerator.kt:60)
        at org.jetbrains.kotlin.ir.util.ExternalDependenciesGenerator.generateUnboundSymbolsAsDependencies(ExternalDependenciesGenerator.kt:50)
        at org.jetbrains.kotlin.ir.backend.js.CompilerKt.compile(compiler.kt:69)
        at org.jetbrains.kotlin.ir.backend.js.CompilerKt.compile$default(compiler.kt:51)
        at org.jetbrains.kotlin.cli.js.K2JsIrCompiler.doExecute(K2JsIrCompiler.kt:223)
        at org.jetbrains.kotlin.cli.js.K2JSCompiler.doExecute(K2JSCompiler.java:181)
        at org.jetbrains.kotlin.cli.js.K2JSCompiler.doExecute(K2JSCompiler.java:74)
        at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:88)
        at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:44)
        at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:98)
        at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1560)
        at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357)
        at sun.rmi.transport.Transport$1.run(Transport.java:200)
        at sun.rmi.transport.Transport$1.run(Transport.java:197)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
        at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:834)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':webpage:compileDevelopmentExecutableKotlinJs'.
> Internal compiler error. See log for more details
r
Are you using any compiler plugins? It's a compiler (well, linker really) issue, if you aren't using any plugins I'd make a issue (kotl.in/issue) with a minimum reproducer.
If I remember right the reason it only shows up in
compileDevelopmentExecutableKotlinJs
is because
compileKotlinJs
only compiles your code, it doesn't link it
a
Looks like I will have to do so. Thanks @rnett
Forgot to mention that I am not using any compiler plugin
Hello folks, please help me in raising awareness of issue. Just go and upvote https://youtrack.jetbrains.com/issue/KT-43549